Can someone give me a tip on how I can use os to run a different .py file from my python script? This code below works, but only because I specify the complete file path.
How can I modify the code to incorporate running plots.py from the same directory as my main script app.py? Im using Windows at the moment but hoping it can work on any operating system. Thanks
import os
os.system('py C:/Users/benb/Desktop/flaskEconServer/plots.py')
os.system('py plots.py')?from . import plots?os.system()call exists. Look into usingsubprocess, a standard-library module literally made for the purpose of executing other programs within a python program