Python without a tty
ben+python at benfinney.id.au
Thu Sep 29 14:32:37 CEST 2011
Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:
> I have a Python script which I would like to test without a tty
> attached to the process. I could run it as a cron job, but is there an
> easier way?
> I am running Linux.
You could crib from the ‘python-daemon’ library implementation
<URL:http://pypi.python.org/pypi/python-daemon>. Part of its job
involves detaching the current program from the terminal.
Or maybe you could simply invoke the library for its main purpose, if
that would be sufficient to do what you need.
\ “Sane people have an appropriate perspective on the relative |
`\ importance of foodstuffs and human beings. Crazy people can't |
_o__) tell the difference.” —Paul Z. Myers, 2010-04-18 |
More information about the Python-list