How to run two py files
How can I first run a py file to open some files and then another py file to run a task. How to run 2 py files or more.
First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
How can I first run a py file to open some files and then another py file to run a task. How to run 2 py files or more.
A python script can be executed by another python script with execfile. Use a main script to execute the two scripts. For example:
execfile('file1.py')
execfile('file2.py')
If the second py needs data from the first py (or wait to finish), then there is no saving in time. It is still a sequential process. It is the dynamic simulation itself that takes the most time in a dynamic study. Use a single file in a parallel process. Do post-processing separate.
Asked: Jun 24 '1
Seen: 265 times
Last updated: Jun 24 '21