Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using python 2.7 and windows 7. I have a python file(.py). I want to launch this script as a windows services, i.e. this code will keep on running from start to end and never terminate.

I can convert .py file into an exe using py2exe. How to launch this and how the code flow works in services. Is it starts from line one to continue to last line, and then again starts from line one of code.

share|improve this question
1  
See this [thread][1] on stackoverflow [1]: stackoverflow.com/questions/32404/… – max890 Mar 10 '14 at 19:36
    
I am getting error as link – sherlock Mar 12 '14 at 12:52

Sorry with my current level in superuser I can't add a comment like my first answer.

Download the required lib with the right version of Python and Windows:

http://sourceforge.net/projects/pywin32/

To install the service, just type:

<Your python Path>\python.exe "Path to your script".py install

I have tested the script in the link you gave me and it's working correctly in my computer.

If you want to delete the service, just type in cmd (as admin):

sc delete "Service Name"
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .