[Geany-Users] Geany on Raspberry Pi... can't see Tkinter window
elextr at xxxxx
Sun May 20 02:10:22 UTC 2018
What happens if you run your script from the command line? I suspect
it will just return the same as it does in Geany. Geany runs things
exactly as if from the command line, so if your script doesn't run
there it won't run in Geany.
The other IDE is a specialist Python thingy which may be doing
something different, possibly helpful for beginners, but not so
helpful when you actually want your script to run as a separate
program independent of the IDE.
On 20 May 2018 at 11:25, Eric Stephan <estephan at fastmail.net> wrote:
> Hello all!
> I have a problem on the Raspberry Pi where Geany will not show the Tkinter
> window when I am making a simple Python app with tkinter graphics.
> I tried asking on Stack Exchange but no luck… I am sorry that I will just
> paste the question below, it’s the easiest way to be clear about it!
> My problem: When I run my simple graphics tkinter python script (pasted
> below) in Geany, it "runs" ... BUT it simply shows the white-text-on-black
> script window proudly announcing that script completed... while the tkinter
> graphics window created by the script does not appear! *** When I do
> this in another IDE, Thonny, the graphics window appears. How do I get
> Geany to show this script's graphics window correctly? THANKS!
> —— below is the code (from a learn-Python book)
> from Tkinter import *
> window = Tk()
> c = Canvas(window, height = 300, width=400)
> def mouth_open():
> def mouth_close():
> def blink(event):
> c.itemconfig(eye, fill='green')
> c.itemconfig(eyeball, state=HIDDEN)
> def unblink(event):
> c.itemconfig(eye, fill='white')
> c.itemconfig(eyeball, state=NORMAL)
> words=c.create_text(200,280,text='I am an alien!')
> def steal_hat():
> c.itemconfig(words, text='Give me my hat back!')
> def burp(event):
> c.bind_all('<Button-1>', burp)
> def eye_control(event):
> if key=='Up':
> if key=='Down':
> if key=='Left':
> if key=='Right':
> Users mailing list
> Users at lists.geany.org
More information about the Users