Exeucte a system command in python script

Robert Kern robert.kern at gmail.com
Thu Jun 8 22:39:18 EDT 2006


ken.carlino at gmail.com wrote:
> Thanks I get this error 'NameError: global name 'call' is not defined"
> 
> I already import 'subprocess'.
> 
> Can you pleaes tell me what am I missing?

Almost certainly you are doing something like this:

  import subprocess
  call(['something', 'or', 'other'])

You need to learn how imports work in Python. Please read the tutorial:

  http://docs.python.org/tut/tut.html

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Python-list mailing list