![]() bashrc, the program works fine, but it launches another instance of the program everytime I open another terminal session - not what I want. I know that it has something to do with subprocess.Popen - if I comment out the subprocess.Popen() and assume what the response would be, the program works fine.Īlso if I start the program from. After youve done, call pipe. How to run a python program in the background even after closing the terminal duplicate Ask Question Asked 9 years, 6 months ago Modified 2 years, 1 month ago Viewed 319k times 63 This question already has answers here : Running programs in the background from terminal (10 answers) Closed 9 years ago. I put some logging code in the program and I can tell that the program sees the GPIO pin go LOW, but the xmessage never comes up. Then, use municate() to send input and get the processs output. ![]() However, if I try to run the program from /etc/rc.local or from crontab to have it start at bootup, it doesn't work - I never get the xmessage. If I run the program from a terminal session using sudo python3 mypgm.py &, it works perfectly. ![]() sets the xmessage info into a variable "cmd" The program uses GPIO.wait_for_edge(pin, GPIO.FALLING) to wait. When the pin goes LOW, the program uses xmessage to display a message and looks for a response. Running a background thread in python Constantly Confused. I have a Python program that runs in the background and watches a GPIO pin. 16 style types quiz popen n background python questions How to run a.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |