How can I create an local webserver for my python scripts?

后端 未结 3 1954
我寻月下人不归
我寻月下人不归 2021-02-01 07:05

I\'m looking to use a local webserver to run a series of python scripts for the user. For various unavoidable reasons, the python script must run locally, not on a server. As a

3条回答
  •  长情又很酷
    2021-02-01 07:26

    Running a native python webserver as a windows service should be a no brainer. Check out the documentation for writing windows services (win32api, ActiveState python) in python and also the documentation for subclassing BaseHttpServer and SimpleHttpServer.

    BTW: I had a similar question on stackoverflow: How to stop BaseHTTPServer.serve_forever() in a BaseHTTPRequestHandler subclass?

    Basically, you subclass BaseHTTPServer (you have to anyway...) and then... but just read the accepted answer - it set me on the right track!

提交回复
热议问题