Skrip restart Python
sys.stdout.flush()
os.execl(sys.executable, 'python', __file__, *sys.argv[1:])
Long Lobster
sys.stdout.flush()
os.execl(sys.executable, 'python', __file__, *sys.argv[1:])
os.execv(sys.executable, ['python'] + sys.argv)
def restart():
import sys
print("argv was",sys.argv)
print("sys.executable was", sys.executable)
print("restart now")
import os
os.execv(sys.executable, ['python'] + sys.argv)