scope acting weird

Gabriel B. gabriel.barros at gmail.com
Sun May 1 17:24:21 EDT 2005


i have the following code:

Ui.py:
import Tkinter as Tk
import UiMainScreen

UiMainScreen.py:
class UiMainScreen( Tk.Frame ):
    ....

and i get the following error:
  File "UiMainScreen.py", line 1, in ?
    class UiMainScreen(Tk.Frame):
NameError: name 'Tk' is not defined

isn't Tk supposed to be imported globaly?
And If i import Tkinter again inside every other file, will it be
really imported several times and be independent in each file or the
python interpreter just use the subsequent imports to know where to
propagate stuff?

Thanks,
Gabriel



More information about the Python-list mailing list