[Tutor] updating Unix config file
Kent Johnson
kent37 at tds.net
Tue Oct 20 16:55:54 CEST 2009
On Tue, Oct 20, 2009 at 10:44 AM, Matt Herzog <msh at blisses.org> wrote:
> Yes, thanks. What failed was the invocation of PIPE. Apparently I had to explicitly import PIPE from subprocess or python had no clue as to what PIPE was!
>
> Dare I say, "wtf?" since when fo I have to specify such? Shouldn't importing the subprocess module make all its methods available? I can't remember having to do this before.
That is standard behaviour of import. If you
import subprocess
then you access its members as subprocess.Popen, subprocess.PIPE etc.
There is nothing special to subprocess or PIPE here.
You can use
from subprocess import Popen, PIPE
if you want to be able to use unqualified names.
Kent
More information about the Tutor
mailing list