![](/img/trans.png)
[英]how do I run multiple python scripts simultaniously using QProcess
[英]How do I run multiple scripts with a single command using the terminal? (python - otoole)
例如,我想一次運行這些:
otoole convert csv datafile 數據 datafile.txt python preprocess_data.py otoole datafile.txt preprocessed_datafile.txt
所以我需要編寫一個腳本,我可以在終端中調用它並自動運行這兩個命令。
我沒有太多使用終端的經驗,我剛剛開始閱讀有關使用 python 執行 shell 命令的信息; os.system、subprocess.run 等
我假設您正在 bash 終端中運行,如果是這樣,您可以使用&&
鏈接多個命令:
python some_file.py && python another_file.py && otoole blabla
或者,創建一個文件some_filename.sh
並在其中,
#!/bin/bash
python some_file.py && python another_file.py && otoole blabla
然后就可以在終端調用腳本了:
./some_filename.sh
對於 bash 腳本,看看這個。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.