execfile() - change python version?

Peter Hansen peter at engcorp.com
Fri Mar 29 22:30:45 EST 2002


Trung Hoang wrote:
> 
> Hi,
> 
> i was wondering if there is a way to change which version of python
> processing the file when execfile().

No.  execfile() is basically "execute this file using the currently
running version of Python".

> i wish to use python2.2 on the main file, and python2.1 on the file passed
> into the argument of execfile().

Don't use execfile().  Use os.system() and run the version you want instead.

> reason being: there is some sort of mis configuration error on the server i
> am using python on.

Sounds like there must be an easier way to solve the problem.  Can
you give more detail on this "misconfiguration error"?



More information about the Python-list mailing list