exec-function in Python 3.+

Jon Clements joncle at googlemail.com
Mon Nov 2 12:34:08 CET 2009

On 2 Nov, 10:49, "Hans Larsen" <jo... at mail.dk> wrote:
> Help!
>     I'm begginer in Python 3.+!
>     If i wih to update a module after an import and chages,
>     How could I do:
>     By "from imp import reload" and then reload(mymodule)
>     or how to use "exec(?)", it is mentoined in docs.
>     In Python ver. <3 reload(module) writes something back to interpretter!,
> how about exec, which is a function?-:)
>     I,m thanking on the help!!

What makes you think you need to 'reload' a module. If you don't know
exactly what you're doing (by saying you're a beginner I'm guessing
not...), and aware of the consequences that can follow... I would say,
*don't*. There's too much to bite you in the rear (and not a blatant
bite from a lion, but rather a playful little kitten that then plays
cute and exudes a "moi?" expression).

Also, it may help others to post their thoughts if you tried to
describe why you think you want to go down this line, and what you're
trying to achieve.


More information about the Python-list mailing list