Shell like syntax for subprocess.Popen # overloading >, <, |
Christos Georgiou
tzot at sil-tec.gr
Tue Apr 18 07:31:01 EDT 2006
On 18 Apr 2006 01:37:03 -0700, rumours say that "jelle"
<jelleferinga at gmail.com> might have written:
>Hi,
>
>I use python quite a bit to couple different programs together.
>Doing so has been a _lot_ easier since subprocess came around, but
>would really like to be able to use the succinct shell syntax; >, <, |
>
>That really shouldn't be too hard to wrap in a class, but so far I
>didn't succeed to do so this well, since I'm facing some trouble with
>operator precedence that I do not know how to overcome.
[snip]
Overload the __or__ special function (ie the 'pipe' operator) instead of the
__gt__ operator.
I remember I have seen such a proposition (mentioning pump, filters and
sinks) but I couldn't find it in google.groups.com --I think Aahz had
something to do with it, but ICBW.
Ah, I found it:
http://mail.python.org/pipermail/python-dev/2004-April/044205.html
I don't know why I remembered Aahz about it :)
Check this too:
http://groups.google.gr/group/comp.lang.python/browse_thread/thread/674a821ed7003b69/777efd4d3aa490ed?lnk=st&q=python+overload+pipe+syntax&rnum=1&hl=en#777efd4d3aa490ed
--
TZOTZIOY, I speak England very best.
"Dear Paul,
please stop spamming us."
The Corinthians
More information about the Python-list
mailing list