Using Python's subprocess module using PyCall

pycall

#1

Why would:

using PyCall
@pyimport subprocess.call as call_prog

result in:

ERROR: LoadError: PyError (:PyImport_ImportModule) <type 'exceptions.ImportError'>
ImportError('No module named call',)

#2

subprocess.call is a function, not a module, and @pyimport only works with modules. Just do

call_prog = pyimport("subprocess")["call"]

# then you can do, for example:
call_prog(["ls", "-l"])
call_prog("ls -l", shell=true)

#3

That make sense. Thank you very much.