who moved reload?

Discussion in 'Python' started by harrismh777, Apr 7, 2011.

  1. harrismh777

    harrismh777 Guest

    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?

    >>> reload(mymod)

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




    regards,
    m harris
     
    harrismh777, Apr 7, 2011
    #1
    1. Advertising

  2. harrismh777

    harrismh777 Guest

    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
     
    harrismh777, Apr 7, 2011
    #2
    1. Advertising

  3. harrismh777

    harrismh777 Guest

    harrismh777 wrote:
    > 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
     
    harrismh777, Apr 7, 2011
    #3
  4. On Wed, Apr 6, 2011 at 10:57 PM, harrismh777 <> wrote:
    > harrismh777 wrote:
    >>
    >> 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.


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

    Geremy Condra
     
    geremy condra, Apr 7, 2011
    #4
  5. harrismh777

    mark Guest

    On Tue, 2011-04-19 at 12:41 -0400, Calvin Spealman wrote:
    > 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.



    --
    Kind regards,
    M Harris
     
    mark, Apr 20, 2011
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave Mehrtens

    Comments Moved in VS.Net

    Dave Mehrtens, Aug 12, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    348
    Jacob Yang [MSFT]
    Aug 13, 2003
  2. Jeff S
    Replies:
    2
    Views:
    9,814
    David Wier
    Nov 4, 2003
  3. Joshua Beall
    Replies:
    26
    Views:
    221,690
    AndreiKaa
    Jun 29, 2007
  4. gen_tricomi
    Replies:
    2
    Views:
    767
    gen_tricomi
    May 23, 2006
  5. Stefan Mueller
    Replies:
    4
    Views:
    309
    Stefan Mueller
    Nov 5, 2005
Loading...

Share This Page