Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 34777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:07:54+00:00 2026-05-10T14:07:54+00:00

I am sketching the architecture for a set of programs that share various interrelated

  • 0

I am sketching the architecture for a set of programs that share various interrelated objects stored in a database. I want one of the programs to act as a service which provides a higher level interface for operations on these objects, and the other programs to access the objects through that service.

I am currently aiming for Python and the Django framework as the technologies to implement that service with. I’m pretty sure I figure how to daemonize the Python program in Linux. However, it is an optional spec item that the system should support Windows. I have little experience with Windows programming and no experience at all with Windows services.

Is it possible to run a Python programs as a Windows service (i. e. run it automatically without user login)? I won’t necessarily have to implement this part, but I need a rough idea how it would be done in order to decide whether to design along these lines.

Edit: Thanks for all the answers so far, they are quite comprehensive. I would like to know one more thing: How is Windows aware of my service? Can I manage it with the native Windows utilities? What is the equivalent of putting a start/stop script in /etc/init.d?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T14:07:55+00:00Added an answer on May 10, 2026 at 2:07 pm

    Yes you can. I do it using the pythoncom libraries that come included with ActivePython or can be installed with pywin32 (Python for Windows extensions).

    This is a basic skeleton for a simple service:

    import win32serviceutil import win32service import win32event import servicemanager import socket   class AppServerSvc (win32serviceutil.ServiceFramework):     _svc_name_ = 'TestService'     _svc_display_name_ = 'Test Service'      def __init__(self,args):         win32serviceutil.ServiceFramework.__init__(self,args)         self.hWaitStop = win32event.CreateEvent(None,0,0,None)         socket.setdefaulttimeout(60)      def SvcStop(self):         self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)         win32event.SetEvent(self.hWaitStop)      def SvcDoRun(self):         servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE,                               servicemanager.PYS_SERVICE_STARTED,                               (self._svc_name_,''))         self.main()      def main(self):         pass  if __name__ == '__main__':     win32serviceutil.HandleCommandLine(AppServerSvc) 

    Your code would go in the main() method—usually with some kind of infinite loop that might be interrupted by checking a flag, which you set in the SvcStop method

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background I'm sketching on an application that needs to perform something like this database
Im sketching out a database layout for a website that has the potential to
I'm sketching a design of something (machine learning of functions) that will preferably want
I want to create a website that allows me to sketch something in real
I can understand how one can write a program that uses multiple processes or
I have noticed that sketching a box and filling a box leads to different
I am currently developing a little sketching application based on HTML5 Canvas element. There
I read the following statement: The x86 architecture includes a specific segment type called
I have an application in which I would like to share a single GPU
I have a Sketching app done in all HTML5 and Javascript, and I was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.