[Tutor] Trying to use tkinter in Pycharm EDU

Lisa Hasler Waters lwaters at flinthill.org
Wed Feb 8 08:00:27 EST 2017


Hello,

We have been able to get the turtle module in PycharmEDU by ending our code
with turtle.done()

However, we cannot get the tkinter module to actually run in PycharmEDU.
For example, when we input the following very simple code we get a line in
the console that reads  "Process finished with exit code" and we can see
that a canvas is trying to open but it never does:

from tkinter import *
tk = Tk()
canvas = Canvas(tk, width=500, height=500)
canvas.pack()

OR this code:

from tkinter import *
tk = Tk()
btn = Button(tk, text="click me")
btn.pack()

Both of these worked fine in IDLE. But we really like the Pycharm EDU and
want to continue using it.

We are working on Macs 10.11.6 with Pycharm EDU 3.0.1.

We are obviously missing something! Any advice would be appreciated!

Thanks so much!

Lisa

-- 
Lisa Waters, PhD
Technology Integration
Middle School Coding
Lower School Digital Literacy
Flint Hill School
703.584.2300
*www.flinthill.org* <http://www.flinthill.org/>


More information about the Tutor mailing list