This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 检测 python 脚本是否运行,一旦检测到程序停止就启动脚本并且将输出显示到当前屏幕上 | |
| # 按下 ctrl + c 后(按一次就行)会依次对接管的脚本发送 ctrl + c,使程序能捕获 KeyboardInterrupt 异常并退出 | |
| import psutil | |
| import os | |
| import sys | |
| import pexpect | |
| from loguru import logger | |
| from time import sleep | |
| from concurrent.futures import ThreadPoolExecutor |