Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
    
See this [thread][1] on stackoverflow [1]: stackoverflow.com/questions/32404/… –  max890 Mar 10 at 19:36
    
I am getting error as link –  sherlock Mar 12 at 12:52

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.