Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tkinter import with PyCharm

I want to create a tkinter window using pycharm:

from tkinter import *

root = Tk()

root.mainloop()

Apparently PyCharm tells me that from tkinter import * is an unused import statement, and root = Tk() is an unresolved reference. What's confusing me is that the code works completely fine, a tkinter window shows up, no errors.

How do I fix this?

Edit: PyCharm shows these error whenever I import any other library I have.

like image 409
PyDer Avatar asked Aug 28 '16 20:08

PyDer


1 Answers

from Tkinter import * 

root = Tk()

thislabel = Label(root, text = "This is an string.")

thislabel.pack()

root.mainloop()

Use Tkinter not tkinter

like image 57
Dennis Simiyu Avatar answered Oct 03 '22 21:10

Dennis Simiyu