在启动时运行Python脚本。(Windows和Raspberry Pi操作系统)

huangapple go评论70阅读模式
英文:

Running a python script from startup. (Windows and RPI os)

问题

我有一些Python脚本,我想在系统启动时启动它们。如何做到这一点?通过启动应用程序吗?我需要将脚本导出为exe,然后将其添加到启动应用程序中吗?树莓派呢?或者其他Linux系统呢?(关于这个问题有一些帖子,但没有一个完全回答我的问题。)

英文:

I have some Python scripts, and I want them to be started at system startup.
How can I do this?
By startup apps?
Do I need to export the script as an exe and then add it to the startup applications?
What about the raspberry pi?
Or another Linux?

(There are some posts about this, but none of them answer exactly my question)

答案1

得分: 1

将要运行的命令添加到文件 /etc/rc.local 中,它将在启动时运行。

英文:

As for the rpios, just add the command you want to run at startup to the file /etc/rc.local. It will be run on startup.

huangapple
  • 本文由 发表于 2023年4月6日 23:28:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/75951234.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定