So, I've recently switched from windows to Linux Ubuntu. My norm is using Tkinter for GUI applications. But from the switch i also realized the Tkinter objects aren't recognized.
I.E
#!/usr/bin/env python
import Tkinter
Window = Tkinter.Tk()
Welcome = Label(Window,"Welcome to Dragive")
Welcome.pack()
Window.mainloop()
Gives me the following error:
NameError: name 'Label' is not defined
This feels so ridiculous seeing as how such a simple script cant be interpreted.
Yes, I have installed python-tk after having realized Tkinter doesn't come pre-packged with linux python. (Very annoying actually)
I have tried
from Tkinter import *
but that gives me this error:
Welcome = Label(Window,"Welcome to Dragive")
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2595, in __init__
Widget.__init__(self, master, 'label', cnf, kw)
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2089, in __init__
for k in cnf.keys():
AttributeError: 'str' object has no attribute 'keys'
All this has been very irritating. Of course in any other instance, this would run in windows. So far linux has given me nothing but trouble in this instance.
Any help would be appreciated, thank you.
text= "..."
, and either doTkinter.Label
or theimport *
although I highly recommend the first.