[Radiance-general] Use Python to execute Radiance command

Greg Ward gregoryjward at gmail.com
Sun Jun 19 09:58:11 PDT 2011


Can't you just add an ampersand ('&') to the end of your rad command to run it in the background?

-Greg

> From: Ji Zhang <hope.zh at gmail.com>
> Date: June 19, 2011 5:48:30 AM PDT
> 
> Dear Radiance experts,
> 
> Suppose you want to use Python to call rad command and render an image using the following script:
> 
> ################################
> import os
> rad_command = "rad -e -v vw1 /test.rif"
> os.system(rad_command) 
> ################################
> 
> Python will hang there until the rad command running in background is finished. During this period, you can do nothing in the Python Shell... 
> 
> So, is there a way to use Python to call the Terminal and "paste" the rad command string into the Terminal and then run rad? In this way, Python is freed from the rad rendering process once it's be activated in the Terminal. 
> 
> Appreciate your advices!
> 
> (using Mac OS 10.6.7, Radiance 4, and Python 2.6.5)
> 
> Ji
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.radiance-online.org/pipermail/radiance-general/attachments/20110619/dd0c6186/attachment.html>


More information about the Radiance-general mailing list