Restart interpreter with function or command
-
@Phuket2 Thank you for the suggestion about the podcast, however I'm not an expert about programming and computer science and in general, due to little free time, I limit myself to deepening only the things I need at a certain moment.
Anyway thank you!
Bye
-
@dgelessus or someone else, hi, sorry could you kindly tell me if function exists to simulate the long press Clear key in Pythonista console to reset environment (that deletes all global variables) to use it programmatically in scripts?
Thank you so much
Bye
-
@Matteo I don't know for sure what the "Reset Environment" option does internally. Most likely it uses the
pykit_preflight.py
script, which Pythonista automatically runs when you press the "play" button on a script (before the script itself runs). You can open thepykit_preflight.py
with this code:import editor import os editor.open_file(os.path.join(os.path.dirname(os.path.dirname(os.__file__)), "pykit_preflight.py"), new_tab=True)
-
@dgelessus Hi thank you for your help, I will try to do some tests about resetting global variables programmatically following what you suggest.
Regards
Bye