Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Restart interpreter with function or command
-
@Matteo , thats great. I also really enjoy the conversations here. They are so enlightening. Even if you are wrong, people are present and helpful. It's nice to be able to ask questions without being intimidated or someone making you feel like you are stupid.
Sort of related but not really, I was listening to a podcast today about web server optimisation. They just mentioned that some companies actually turn off the gc expect for the reference counting part and periodically just restart the service. Apparently can speed things up. But this is in a system made up of micro services where a service can be elegantly be restarted and other services are in place to handle the requests of the service being restarted. Sorry, its a bit of a tangent, but I found it interesting. Here is the link to the podcast if you are interested. -
@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