who moved reload?

H

harrismh777

All right... somebody is sacked (er, fired) !

Who moved reload()?

This kinda stuff is driving me bonkers... there was no need to move
reload() anyplace...

.... so for those of you who haven't found out yet, if you want to reload
a module in 3.x you have to import reload() first from module 'imp' ...
now that is just plain wrong. :-}


import mymod

from imp import reload
reload(mymod) <<===== now reload() will work.



Somebody out there thinks this is funny, right?
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
reload(mymod)
NameError: name 'reload' is not defined ???????????????????????????


regards,
m harris
 
H

harrismh777

You guys want one more...?

.... we can't import tkconstants any longer.... nope.


import tkinter.tkconstants

(oh, and watch that first t on Tkinter, its doozy)


nice.


(ask me how long it took to find that... nah, wait till I'm not so
grumpy... couple days from now)


regards,
m harris
 
H

harrismh777

harrismh777 said:
You guys want one more...?

... we can't import tkconstants any longer.... nope.


import tkinter.tkconstants

oops... so upset I finger-checked... long day...

This works:

import tkinter
from tkinter.constants import *


This used to work:

import Tkinter
from Tkconstants import *

.... not any more.


regards,
m harris
 
G

geremy condra

oops... so upset I finger-checked...  long day...

This works:

import tkinter
from tkinter.constants import *


This used to work:

import Tkinter
from Tkconstants import *

...  not any more.

Yep, things have moved. Glad you're finding your way around now!

Geremy Condra
 
M

mark

I have a great solution : stop using reload. It often dangerous and
more often silly.

Yeah, I'm there. Some of this is just learning a new way of thinking
about the language. I can see that not using reload at all makes more
sense (Run --> Run Module) from the editor window which does what I want
with a mouse click... so I'm done with reload...

In the past I didn't use IDLE... just vi, reload(yadda yadda) in the
terminal, repeat till bored. There were some inconsistencies with
from yadda yadda import *... and it seems that reload was deliberately
hidden in imp to solve some of that problem. And we can still use
imp.reload() to reload the module without stopping the interpreter, so
all is good.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top