I have a long-running Python server and would like to be able to upgrade a service without restarting the server. What\'s the best way do do this?
if foo.py
The following code allows you Python 2/3 compatibility:
try: reload except NameError: # Python 3 from imp import reload
The you can use it as reload() in both versions which makes things simpler.
reload()