你好这是我的剧本:
import sys
import LED
import os
import subprocess
if __name__ == '__main__':
LED_BLUE=LED.LED(15)
if(sys.argv[1]=='1'):
with open('/home/pi/Work/B','w') as f:
f.write('1')
os.system('sudo python /home/pi/Work/Bluetooth.py')
print '1'
elif(sys.argv[1]=='0'):
with open('/home/pi/Work/B','w') as f:
f.write('0')
print '0'
现在当我像这样运行这个脚本时:sudo python /home/pi/Work/SetB.py 0
0
中的并且不要释放tty,我需要按ctrl + z来释放tty
答案 0 :(得分:2)
尝试添加:
os._exit(0)
每当您的流程完成时。