PYTHON获取进程状态
通过pid查询
r = os.system(f'ps -ef|grep {status}|egrep -v grep')
if r == 256:
print('进程不存在')
elif r == 0:
print('进程运行中')
查询文件更新时间
t = os.path.getatime(videoPath)
print([t])
通过pid查询
r = os.system(f'ps -ef|grep {status}|egrep -v grep')
if r == 256:
print('进程不存在')
elif r == 0:
print('进程运行中')
查询文件更新时间
t = os.path.getatime(videoPath)
print([t])