I'm trying to call a python program from inside a program what do I use. I have a python file that checks a file name and if it's a certain file I want to run another program. Any suggestions on what to use.
1 Answer
You can use the os.system command.
import os
os.system('python my_file.py')
i got this from https://www.tutorialspoint.com/How-can-I-make-one-Python-file-run-another
3 Comments
Bill Judge
Well my second program didn't run
coder
well i got it from the website so idk whats happening i will test
coder
import os os.system('python my_file.py') worked for me