Advertisement
raphtlw

Untitled

Oct 20th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. import tkinter
  2.  
  3. window = tkinter.Tk()
  4. # to rename the title of the window
  5. window.title("GUI")
  6. # pack is used to show the object in the window
  7. label = tkinter.Label(window, text="Hello World!").pack()
  8. window.mainloop()
  9.  
  10. # error
  11. Traceback (most recent call last):
  12.   File "C:/Users/raphp/PycharmProjects/LearnPython/Intermediate/tkinter.py", line 1, in <module>
  13.     import tkinter
  14.   File "C:\Users\raphp\PycharmProjects\LearnPython\Intermediate\tkinter.py", line 3, in <module>
  15.     window = tkinter.Tk()
  16. AttributeError: module 'tkinter' has no attribute 'Tk'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement