newbie troubles: os.popen confusion

  • Thread starter Jelle Feringa // EZCT / Paris
  • Start date
J

Jelle Feringa // EZCT / Paris

Hi,

I'm learning python at the moment, and am trying to write some basic shell
scripts to start off with.
I having trouble executing programs from within python.
Very basic operations such as:

work out just fine, but when I do the same thing with a specific program, it
doenst work out.
mr = os.popen(str(os.environ['MI_ROOT']) + 'ray3.exe').readlines()
mr
[]

So I tried calling the program using win32pipe.
The program gets launched, but when I try to connect to its output
--o.readlines()-- the script is stuck until the process is killed.
Also it seems to me that using win32pipe.popen2 options are specified in a
different way than in os.popen where I can specify these directly.
Could you put me in the right direction?

Cheers,

Jelle.
mr, o = win32pipe.popen2(str(os.environ['MI_ROOT']) + 'ray3.exe')

---actually "mr, o = win32pipe.popen2('ray3.exe')" does the same
thing, its finding the program in the environment---

<open file 'C:\Softimage\XSI_4.0\Application\bin\nt-x86-p3\ray3.exe', mode
'w' at 0x018735E0>

stops running the script until I kill the process
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top