Re: [Tutor] Exec function problem

2010-09-01 Thread Alan Gauld
"Currall, Andrew" wrote DemandModel.py is a valid, working python script. If I create another script file, then: execfile('DemandModel.py') You probably shouldn't. You should probably be importing it. Is there a reason why you want to use execfile()? Its nearly always the wrong solution.

[Tutor] Exec function problem

2010-09-01 Thread Currall, Andrew
Using Python 2.5. DemandModel.py is a valid, working python script. If I create another script file, then: execfile('DemandModel.py') works fine. However, the apparently similar: def runfile(): execfile('DemandModel.py') runfile() doesn't, for no apparent reason: I get File "Demand