Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: Running Daemon Processes in Windows7

Tags:

python

windows

I had a program that Scraped certain data from certain Web-Pages, and when the Web-Pages changed, acted accordingly.

How would one set up the program so it continues to run in the background?

I don't need any specifics

I'm just really confused on this concept and would appreciate whatever help anybody has to offer.

like image 843
Aaron Tp Avatar asked Feb 14 '12 04:02

Aaron Tp


People also ask

How do I run a daemon process in python?

Daemon processes in Python To execute the process in the background, we need to set the daemonic flag to true. The daemon process will continue to run as long as the main process is executing and it will terminate after finishing its execution or when the main program would be killed.

Does Windows use Daemon?

On Microsoft Windows NT systems, programs called Windows services perform the functions of daemons. They run as processes, usually do not interact with the monitor, keyboard, and mouse, and may be launched by the operating system at boot time.

What is the equivalent of daemon process in Windows?

In Microsoft Windows, software that runs as a non-interactive background process is called a service. A Windows service performs roughly the same role as a Linux or Unix daemon.

What is a daemon in Python?

The threads which are always going to run in the background that provides supports to main or non-daemon threads, those background executing threads are considered as Daemon Threads. The Daemon Thread does not block the main thread from exiting and continues to run in the background.


1 Answers

start path-to-pythonw.exe your-code.py

pythonw means without console.

start means start on background.

if your python is installed system-wide, you can probably start your-code.pyw

.pyw is associated with pythonw.exe

remember you cannot use print (to stdout) in this case.

like image 162
Dima Tisnek Avatar answered Oct 07 '22 02:10

Dima Tisnek