How to call another file

Kragen Sitaker kragen at pobox.com
Fri May 17 04:21:33 EDT 2002


"Catherine Yang" <yiyang at wharton.upenn.edu> writes:
> It doesn't matter what file it is. It can be a C file. By "calling", I mean
> executing another file. I want to use Python to finish some tasks, then use
> another file (*.sas) to finish another task, then return to Python to
> continue. It's like executing a system command from Python, I guess.

If you're on a Unix system, generally, no matter what (interpreted)
language a program is written in, you can run it with os.system,
e.g. os.system("/home/yiyang/analyze-fatalities.sas").  But on more
primitive systems, like Windows, you will need to figure out where SAS
lives and invoke SAS with the file.

HTH.




More information about the Python-list mailing list