[Tutor] (no subject)
Isr Gish
isrgish at fastem.com
Tue Mar 23 00:40:41 EST 2004
-----Original Message-----
>From: "Jeff Peery"<jeffpeery at yahoo.com>
>Sent: 3/16/04 5:23:20 PM
>To: "tutor at python.org"<tutor at python.org>
>Subject: [Tutor] (no subject)
>
>is there a general clear everything function - other than "del" which I think only works one variable at a time? I've used matlab and there is a function "clear" that I like to call at the beginning of my scripts. My problem is that sometimes in python I make changes to my script and I run it and the changes don't appear, python runs the old version. I'm saving all my scripts before I run them, but I still don't see python using my latest save. I thought that if there was a way to clear the variable list that that would solve my problem. Sometimes I have to close python IDLE and reopen it to get it to run my last save.
>
You have to reload the module in order for it to use the newer version.
There is a function called reload (for obvious reason) that reloads the module.
>I also noticed that python might be running off the *.pyc document and not the script itself, is there a way to prevent the *.pyc from being created?
>
Actually every time you run a script (or module) it crrats a .pyc from the .pybfile and then runs the .pyc.
When the .py module is newer the intepreter knows it and creates a new .pyc file from the new .py file.
>thanks!
>
>Jeff
>
All the best,
Isr Gish
More information about the Tutor
mailing list