How to run a python script in the background?

前端 未结 6 592
耶瑟儿~
耶瑟儿~ 2020-11-29 04:46

I have a script that checks something on my PC every 5 minutes and I don\'t want Python to show on my task tray. I use Windows as my operating system.

Is there any w

相关标签:
6条回答
  • 2020-11-29 05:16

    You could run it as a service. See here

    0 讨论(0)
  • 2020-11-29 05:16

    To Run python file from any where :

    Step 1:

    Create Shortcut of Python File.
    

    Step 2:

    Place Shortcut in this location  C:\ProgramData\Microsoft\Windows\Start Menu\Programs
    

    Step 3:

    Now Right Click --> Go to Properties --> Shortcut --> Press any key on keyboard it will take one shortcut key
    

    Step 4:

    Now , Type the Shortcut key which you entered in previous step.
    

    Step 5:

    Check out Output!   :)
    
    0 讨论(0)
  • 2020-11-29 05:19

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

    0 讨论(0)
  • 2020-11-29 05:23

    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.

    0 讨论(0)
  • 2020-11-29 05:25

    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.

    0 讨论(0)
  • 2020-11-29 05:28

    Look for Schedule Tasks in the control panel.

    0 讨论(0)
提交回复
热议问题