[Tutor] Problem w/ redirect to shell

Jeff Shannon jeff@ccvcorp.com
Tue, 30 Jul 2002 18:25:05 -0700


SA wrote:

> How do I tell python to execute that command in the tcsh shell?

import os
os.system('string containing shell command here')

That should execute the given string using whatever the default shell is.  If
you need to capture the output of the command, then look into the os.popen()
family of functions.

Hope that helps...

Jeff Shannon
Technician/Programmer
Credit International