run Backtest script from other script with os.system('Backtest.py') doesn't work
-
Hello,
I wrote a Backtest.py script. In this script I start to initialize some variables, than there are 7 classes and in the end I run the cerebro when:
if __name__ == '__main__': cerebro = bt.Cerebro() ... ...
If I run the script manually, the backtest works perfectly and I get exactly the results I want.
But if I want to run this script from another Script like this:import os import Backtest os.system('Backtest.py')
for this I put all the scripts in one folder and imported each script in the Runner Script. Each script works perfectly, only the Backtest.py script gives the error message
sh: Backtest.py: command not found
I also have to mention that the other scripts (which work and can also be executed by the runner script via os.system ) all contain no classes and no "if name == 'main':".
Does anybody know why this backtest.py script is not found and how I can solve this problem?
best regards
Christian