[Python-ideas] Function multiple arguments assignment
Joao S. O. Bueno
jsbueno at python.org.br
Wed Mar 23 01:25:13 CET 2011
On Tue, Mar 22, 2011 at 8:35 PM, geremy condra <debatem1 at gmail.com> wrote:
> On Tue, Mar 22, 2011 at 3:47 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>> Paul Moore wrote:
>>>
>>> On 22 March 2011 10:01, Nick Coghlan <ncoghlan at gmail.com> wrote:
>>>
>>>>> subprocess.Popen(["exe"], stdin=stdout=stderr=subprocess.PIPE)
>>
>> Perhaps subprocess.Popen could have a 'default' argument
>> specifying what to do for unspecified file descriptors.
>> Then the above could be written
>>
>> subprocess.Popen(["exe"], default = subprocess.PIPE)
>
> Not to be too pointed about it, but IMO the last thing
> subprocess.Popen needs is more keyword arguments. I realize that it
> needs to be many things to many people, but its signature already
> requires >50 lines of documentation and a similar volume of example
> text to explain. To me, Nick Coghlan's more-helper-functions approach
> seems more sensible here.
In other news, last week I needed to "detach" a subprocess, and thre
is no high-level way to do it. There is very little documentation on this,
one mostly has to follow C documentation using "for" and arcane system calls
(os.setsid and os._exit) to get a process to be daemonized.
Maybe subprocess could include a call to take care of all this mess -
(or is it indeed only me who needs to detach processes? )
I followed the recipe from [1] and could not get it simpler
[1] - http://stackoverflow.com/questions/972362/spawning-process-from-python
>
> Geremy Condra
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
More information about the Python-ideas
mailing list