Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

restart python after script execution

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #restart #python #script #execution
ADD COMMENT
Topic
Name
9+1 =