Other difference with Perl: Python scripts in a pipe

Alan Bawden alan at csail.mit.edu
Fri Mar 11 01:45:54 EST 2016


Fillmore <fillmore_remove at hotmail.com> writes:

> On 3/10/2016 7:08 PM, INADA Naoki wrote:
...
> I don't like it. It makes Python not so good for command-line utilities
>

You can easily restore the standard Unix command-line-friendly behavior
by doing:

    import signal
    signal.signal(signal.SIGINT, signal.SIG_DFL)
    signal.signal(signal.SIGPIPE, signal.SIG_DFL)

-- 
Alan Bawden



More information about the Python-list mailing list