On Tue, Oct 20, 2009 at 10:44:16AM -0400, Matt Herzog 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.

It's always been like that.  Otherwise we'd have lots of collisions between 
module global
names that namespaces are designed to avoid in the first place.  So you either 
name them
explicitly, or import them explicitly:

import subprocess
# now you can reference subprocess.PIPE

--or--

from subprocess import Popen, PIPE
# now you can reference PIPE without the namespace identifier

--or--

from subprocess import *
# but I don't recommend this one (caution! danger!)

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to