Saturday, May 18, 2013

Good news is - you don't have to write any extra code to run your Python application in a separate process (so called daemonization). All you need is - fully specified name of the method/function to execute. Something like:


Everything else is handled by [1]. is a set of friendly Python tools to install Virtual Environment, start, stop your application. In addition it gives you a single interface to test and analyze your code; provides configuration management.

In this post we will outline two features: installation and daemonization.

Installation. It's simple. will create a Virtual Environment for you and make sure that your application is executed within it. What you need to do is to download all of the required libraries for your application and place them in folder: 

Order of the libraries installation is defined by script:

Once this step is complete just run ./ -i to install Virtual Environment along with all of required libraries. is also there to help with the application start and stop. There are two modes to run your application:
  • daemonized
    the application is started in a separate process
  • interactive
    the application is executed in the same command-line terminal where you have called and uses shared stdin, stdout and stderr to interact with the user
To use this feature simply follow the guide:
  1. Write the actual code
    List of the following assumptions is in place:
    - starter method or function has signature starter_name(*args)- classes implement __init__(self, process_name)
  2. Register your fully specified function/method name in as follows:
        'YOUR_PROCESS_NAME': _create_context_entry(

    Should you wish to instantiate a class instance and start its method - simply define the class name:


  3. ./ --run --app YOUR_PROCESS_NAME will start your class' or script's starter method/function in a separate process (daemonized mode) 
  4. Add --interactive to the command above and run it in an interactive mode
In summary - is here to make your life easier. You can find details and read on many other features of the framework at its wiki [2].


[1] on the Github

[2] WIKI

No comments: