How do I run one Python file from another?

Daniel William

New member
How do I run one Python file from another?
Answer
How can I make one Python file run another?
  1. Use it like a module. import the file you want to run and run its functions. …
  2. You can use the exec command. execfile(‘file.py’) …
  3. You can spawn a new process using the os. system command.
 

Tìm kiếm

Back
Top