Python without a tty
bcloete at gmail.com
Thu Sep 29 16:45:53 CEST 2011
> It doesn't appear so to me.
> [steve at sylar ~]$ tty
> [steve at sylar ~]$ setsid tty
> [steve at sylar ~]$ python -c "import sys,os; print
> [steve at sylar ~]$ setsid python -c "import sys,os; print
> If I run the same Python command (without the setsid) as a cron job, I
> get False emailed to me. That's the effect I'm looking for.
Maybe nohup is what you looking for?
>From the info pages...
"`nohup' runs the given COMMAND with hangup signals ignored, so that the
command can continue running in the background after you log out.
nohup COMMAND [ARG]...
If standard output is a terminal, it is redirected so that it is
appended to the file `nohup.out'; if that cannot be written to, it is
appended to the file `$HOME/nohup.out'. If that cannot be written to,
the command is not run. If standard output is not a terminal, then the
standard output of COMMAND will be the same as that of `nohup'.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list