How to run another .py file w/o exec command?

Miki Tebeka miki.tebeka at zoran.com
Mon Mar 29 07:17:32 EST 2004


Hello CaptainN,

> I'm sure there's a way to do this, but I can't find it.  How can I execute
> another .py file from my first .py file without using an exec* command?
> They're both in the same directory, and it would be nice to have some
> run("another.py") type statement as opposed to a big exec with absolute
> pathnames and garbage like that.
http://www.python.org/doc/current/lib/built-in-funcs.html#built-in-funcs
Search for execfile

HTH.
Miki



More information about the Python-list mailing list