Python 2.5 execfile() works only once, why ?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sat Oct 10 10:04:47 CEST 2009


On Fri, 09 Oct 2009 20:15:48 +0200, Stef Mientki wrote:

[...]
> The above code (with or without the stdout redirection), works perfect,
> ....
> ... the first time ...
> but does (almost?) nothing (doesn't crash, try / except around
> execfile), although the source file "self.Edit.Filename" has changed.


What do you mean "doesn't crash, try / except around execfile"? Are you 
*expecting* it to crash?

Are you catching an error and suppressing it? What happens if you remove 
the try...except? Are you sure that execfile is actually being called? 
How do you know?

Are you running your code inside an IDE? If so, it's possible the IDE is 
doing something funny.


-- 
Steven



More information about the Python-list mailing list