-2

What is the python command to run a py-file.?

For example, in my index.py file how would i launch start.py.

Deepend
  • 4,057
  • 17
  • 60
  • 101
Sergey
  • 869
  • 2
  • 13
  • 22

1 Answers1

2

In index.py, simply use subprocess:

import subprocess
subprocess.check_output(["python", "start.py"])
Uli Köhler
  • 13,012
  • 16
  • 70
  • 120