Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 Web 应用程序Flask,用户可以发送一些我的脚本正在处理的请求,然后在控制台中的 python 中运行另一个脚本,其中包含一些参数,如下所示:
Flask
import sys os.system('python start.py -u 100 -p 122224')
一切正常,但现在我想控制我的脚本的所有正在运行的副本,比如开始、停止和暂停。
没有拐杖我怎么能做到这一点?
检查子进程和多处理模块。第一个允许您执行外部应用程序。要使用第二个,您将需要调用一些 python 代码,但管理功能应该更广泛。