简体   繁体   English

如何保持python编程持续运行

[英]How to keep python programming running constantly

I made a program that grabs the top three new posts on the r/wallpaper subreddit. 我编写了一个程序,在r / wallpaper subreddit上获得了前三名新职位。 It downloads the pictures every 24 hours and adds them to my wallpapers folder. 它每24小时下载一次图片,并将其添加到我的wallpaper文件夹中。 What I'm running into is how to have the program running in the background. 我遇到的是如何让程序在后台运行。 The program resumes every time I turn the computer on, but it pauses whenever I close the computer. 每次我打开计算机时,该程序都会恢复,但是每当我关闭计算机时,该程序都会暂停。 Is there a way to close the computer without pausing the program? 有没有办法在不暂停程序的情况下关闭计算机? I'm on a mac. 我在Mac上。

Programs can't run when the computer is powered off. 关闭计算机电源后,程序将无法运行。 However, you can run a computer headlessly (without mouse, keyboard, and monitor) to save resources. 但是,您可以无头运行计算机(无需鼠标,键盘和显示器)以节省资源。 Just ensure your program runs over the command line interface. 只要确保您的程序在命令行界面上运行即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM