Cancelling a subprocess based on its output

jelle jelleferinga at gmail.com
Mon Jul 4 08:13:07 EDT 2005


Hi,

I'm using the subprocess module to run a open-source lighting
simulation software, Radiance, and am using python to script it. When
Radiance finds a scene where no light is present its prints out
'warning - no light sources found' to the console. I'm looking for a
way to terminate the subprocess when this message is spitted out to the
console. Searching this forum on subprocess & stderr didn't lead to a
clue to solving this problem. I'm using both win32 & linux to run these
simulations, so a cross-platform way of doing this is important. Any
suggestions?

Cheers, Jelle.




More information about the Python-list mailing list