from my.application import some_module
from os.path import join, dirname
from sys import argv
argv[1:] = ['-y', join(dirname(some_module.__file__), 'myapp.py'),
    '--pidfile', '/var/run/myapp.pid', '--logfile', '/var/run/myapp.log']
run()
Twisted application without twistd