import subprocess def start(): file_to_run = 'on.py' subprocess.run(['python', file_to_run]) if __name__ == '__main__': start()