使用Python在启动时运行脚本
我正在尝试创建一个在启动时自动运行的Python脚本,但是由于我需要在所有平台上使用它,因此无法使用Windows上的任务调度程序之类的内容运行。可以使用Python做到这一点吗?
I'm trying to create a python script that automatically runs at startup but since I need it to work on all platforms it cannot be run with something like Task scheduler on Windows. Is it possible to do that with python ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试制作在启动时运行的批处理脚本。此批处理脚本将
cd
到包含要运行的Python文件的目录,并最终通过执行python main.py
来运行Python文件。You could try making a batch script that runs at startup. This batch script would
cd
to the directory containing the python file that you want to run, and ultimately run the python file by doingpython main.py
.