Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
563 views
in Technique[技术] by (71.8m points)

raspberry pi - How to automatically launch python file once GUI has loaded on Raspbian Pixel

I now this has been asked before, but I have spent hours and hours trying to find out how to do this and absolutely nothing has worked. I have a python file that I want to automatically run in a terminal window after the pi has booted and loaded its GUI.

I don't know what else to do, and the annoying thing is I had it working for the same project (it took a long time to find out how then as well), but the pi crashed today and I can't remember how to do it again. All I can remember is that I added something to a file ending in /autostart, if that helps.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I was able to launch a python file on startup by running sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart and adding @lxterminal -e python /home/pi/weatherStation/core.py at the end of the file


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...