i have 2 scripts, both multiprocessing utilized scripts.
build.py
reads db , spits out text file. parallel jobs launched this.
push.py
inserts/updates text file persistent db. again, multiprocessing too.
currently have 2 separate crontab commands this. want build.py
launch push.py
terminate itself, how can this?
you can use subprocess
in build.py
import subprocess def main(): # multiprocessing code, wait processes finish ... # launch push.py , exit subprocess.popen(['python', '/path/to/push.py']) if __name__ == '__main__': main()
Comments
Post a Comment