我有一个脚本,应该24/7运行,除非中断。这个脚本是脚本A. 我希望脚本A调用脚本B,并且脚本A在B运行时退出。这可能吗? 这就是我想会的工作 #script_A.py
while(1)
do some stuff
do even more stuff
if true:
os.system("python script_B.py")
sys.
说,我已经写娄代码: import os
import subprocess
for i in os.system('ls'):
print i
我有以下错误: Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError: 'int' object is not ite
可能的How to start a background process in Python? 不过了许多解决方案的重复实现使用os.system(CMD&)行为与子模块,只os.system(commandToRunInBackground &)看似简单,做的伎俩。 虽然根据Replacing os.system(),更推荐使用subprocess模块。 那么如何使用subprocess模块在s
我运行一个Rpi W(Rbian Jessie),就像一个带有以下脚本的timelapse倒计时系统,允许每分钟拍摄一张照片,并在按钮关闭时进入睡眠状态。程序每5秒检查一次按钮。 # This Python file uses the following encoding: utf-8
from time import sleep
from picamera import PiCamera