How To Execute A Python File From Another Python File

run py file in another py file
os.system('python my_file.py')
how to execute a python file from another python file
import myfile

myfile.myfunction


#calls a specific function from within the file
run python file from another python file
subprocess.call(" python script2.py 1", shell=True)

Leave a Comment