0

I'm writing a Python 3 program in Windows and I would like to be able to continue running the program in the background (not in the taskbar) to gather information.

I was able to create it as a service, but I need admin privileges to run and it stops immediately!

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Luke Dinkler
  • 731
  • 5
  • 16
  • 36

1 Answers1

1

It sounds to me like what you want is to make your program a Windows service. There's a bunch of good information in this other question: Is it possible to run a Python script as a service in Windows? If possible, how?

Community
  • 1
  • 1
  • Thanks for the reply! I tried the code in the link in my program and I got printed instructions that I Don't understand: I put the instructions I got in my question. You can probably tell that I don't really know what i'm doing! – Luke Dinkler Aug 28 '14 at 14:13
  • Also. Keep in mind that i'm going to eventually compile my code into an executable. – Luke Dinkler Aug 28 '14 at 16:08
  • @Luke: I'm guessing your script is LIP.py, correct? and you ran it from the command line like: python LIP.py? If so, the usage output is telling you that you need to pass in some options to start your script as a service, try: python LIP.py --install – Greg Chapman Aug 28 '14 at 16:38
  • Yes. But I actually run it from IDLE, and after that, it should be an executable. – Luke Dinkler Aug 28 '14 at 16:39
  • @LukeDinkler I'm fairly certain that the command line arg's will be the same when you run it as an exe, so you'll just start it: LIP --install. – Greg Chapman Aug 28 '14 at 16:42
  • Ok. I've run it from the command line, and it runs, but I don't see it under 'services' in the task manager, and how do I see if it is running in the backround? – Luke Dinkler Aug 28 '14 at 16:44
  • Wait. Now it shows in the command line "option --install not recognized"! – Luke Dinkler Aug 28 '14 at 16:55
  • @LukeDinkler try adding --startup="auto" startup defaults to manual, but I'm not enough of a Windows guru to tell you how to manually start a service – Greg Chapman Aug 28 '14 at 17:04
  • Now it starts in the command line, but I get an error in the log, "Error installing service: Access is denied. (5)"! – Luke Dinkler Aug 28 '14 at 17:07
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/60185/discussion-between-greg-chapman-and-luke-dinkler). – Greg Chapman Aug 28 '14 at 17:09