Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexprengere/daemonify
Daemonify a Python script.
https://github.com/alexprengere/daemonify
Last synced: about 1 month ago
JSON representation
Daemonify a Python script.
- Host: GitHub
- URL: https://github.com/alexprengere/daemonify
- Owner: alexprengere
- License: apache-2.0
- Created: 2014-03-28T14:17:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-13T08:59:34.000Z (over 8 years ago)
- Last Synced: 2024-10-12T18:57:16.658Z (2 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
Daemonify
=========Daemonify a Python script.
Example
-------Just import the Daemon class and subclass it, overriding the *run* method.
.. code-block:: python
from daemonify import Daemon
class ExampleDaemon(Daemon):
def run(self):
import time
while True:
time.sleep(1)daemon = ExampleDaemon('/tmp/example-daemon.pid')
daemon.start() # Daemon is running!# This can be called from another instance, as long
# as the same pidfile is given at init.
daemon.stop()With the example:
.. code-block:: bash
$ python examples/daemon_example.py start
$ python examples/daemon_example.py stop