executing a command

A

andrea valle

Hi to all,
I need to run a program from inside python (substantially, algorithmic
batch processing).
I'm on mac osx 10.3.8 with python 2.3 framework and macpython.

Trying to use exec*, I checked references, Brueck & Tanner, and then
grab this code from effbot:
os.execvp(program, (program,) + args)
print "ok"

Traceback (most recent call last):
File "<pyshell#50>", line 1, in -toplevel-
run("python", "/Users/apple/Desktop/prova.py")
File "<pyshell#49>", line 2, in run
os.execvp(program, (program,) + args)
File
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/os.py", line 336, in execvp
_execvpe(file, args)
File
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/os.py", line 374, in _execvpe
func(fullname, *argrest)
OSError: [Errno 45] Operation not supported

This OSError seems to be consistend with all exec family. What does it
mean and how to use exec?

I also tried with. os.system. It works if I invoke python, but it fails
(in a way I don't know) when I invoke other programs.

For example:
command = "python /Users/apple/Desktop/test.py"0
(test.py write a string in a file. It works)

But with lilypond or with latex I have no output (and in fact it
doesn't give 0 as result):
32512

Any help is much appreciated

Thanks a lot

-a-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top