[Tutor] Running multiple python scripts from one python scripts
ose micah
osaosemwe at yahoo.com
Thu Oct 24 09:35:24 EDT 2019
Hello Alan,
I am having issues in running multiple python scripts in one same program. The reason is that, I am creating this mini scripts in the main (master) scripts, then at the end run them all sequentially.
here is a sample.
import osimport sys...............os.system('python /tmp/delete_line3.py')os.system('python /tmp/create_20lines.py')os.system('python /tmp/delete_ON2_.py')os.system('python /tmp/create_50.py')
when I tried this, only the first script "delete_line3.py" ran and quitted. The rest did not execute.
Next I tried this program.
import fileinputimport subprocess as sp............... extProc = sp.Popen(['python','/tmp/delete_line3.py'])sp.Popen.terminate(extProc)extProc = sp.Popen(['python','/tmp/create_20lines.py'])sp.Popen.terminate(extProc)extProc = sp.Popen(['python','/tmp/ delete_ON2_.py'])sp.Popen.terminate(extProc)extProc = sp.Popen(['python','/tmp/ create_50.py'])sp.Popen.terminate(extProc)
it did not work at all.
is there anything that I can do to
Thanks and regards,
Ose Micah.
More information about the Tutor
mailing list