The answer is no, until the latest versions of Python (non-stable).
Looking at the source for 3.2.3, you can see that information isn't stored in the object (it is discarded). However, in the latest development version of Python, it has been added as subprocess.Popen.args
.
So, presuming this makes it into 3.3, the only time you will see this as a feature is then. The development docs don't mention it, but that could just be them not being updated. The fact that it's not prefixed with an underscore (_args
) implies that it is intended to be a public attribute.
If you are desperate to do this as part of the object, the easiest answer is simply to subclass subprocess.Popen()
and add the data yourself. That said, I really don't think it's worth the effort in most cases.
>>> class NamedPopen(Popen):
... def __init__(self, cargs, *args):
... Popen.__init__(self, cargs, *args)
... self.args = cargs
...
>>> x = NamedPopen("ls")
>>> x.args
'ls'