import os import sys args = ['python', 'test4.py'] os.execv(sys.executable, args)