Skip to content

How to restart program in Python?

import os
import sys
os.execl(sys.executable, sys.executable, *sys.argv)
See also  Python code snippet - How to use if else in lambda ?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.