os.spawnv & stdin trouble

Jelle Feringa // EZCT / Paris jelle.feringa at ezct.net
Tue Jan 11 11:31:07 EST 2005

##I know I should be using 2.4 and os.Popen, I know, I know.
##However, since most modules I need, I'm using 2.3 for this script
I'm having troubles executing a shell script.
The thing is that I'm produing material and geometry files that need to be
compiled to a binary description (for those familiar to Radiance, oconv)
The trouble I'm having is that when python goes through my loop, files are
overwritten before os.system was able to process these! (who ways
complaining python is slow, well I'm not!! ;-) So the obvious thing to do is
to swap os.system for os.spawnv.
Here's where I run into trouble.
In my os.system version, I'm perfectly able to pipe into another file,
since the process has no real connection to python whatsoever.
Would someone be able to explain me how to do this, all the tools I'm using
for this script are unix-like tools and heavily rely on piping.
program = 'xform.exe'
path = 'c:\Radiance\bin\'
args = ['-t 0 8 0', 'wall0.rad', '>', 'wall0.TRANS.rad']
os.spawnv(os.P_WAIT, path, ('xform', args))
here's the cmd error message:
xform: cannot find file ">"
##for your info I'm on win/xp, python 2.3.4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050111/ea25c73c/attachment.html>

More information about the Python-list mailing list