How to run a python script in the background?

房东的猫 提交于 2019-11-27 03:59:33

Look for Schedule Tasks in the control panel.

If you run a console script using pythonw.exe, it will neither display a window nor appear in the task bar. For example, I use the following command to launch ntlmaps on startup:

C:\BenBlank\Python2.6\pythonw.exe scripts/ntlmaps

Be aware, however, that there is no way to interact with the script, nor to terminate it save via the Task Manager.

Just another option you have:

You can create a shortcut to your Python script, then right-click the shortcut --> Properties --> Shortcut tab

There is a drop-down box under the Run option which lets you run the command minimized.

You could run it as a service. See here

MahdeTo

cron it on linux; schedule it on windows [control panel > scheduled tasks > Add scheduled task]

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!