Raspithon
Posts: 1
Joined: Thu Aug 22, 2013 5:56 pm

Tkinter modules

Thu Aug 22, 2013 6:15 pm

I have a raspberry pi and i a entry box from a raspberry pi book.
Here is my program code:

#! usr/bin/ env python
from tkinter import *
window = Tk()
_____________________________________________________________________________________________________
And here is the bit i am having problems with:

def dialog() :
box.showinfo('Greetings',Welcome')
_____________________________________________________________________________________________________

I am particularly having problems with the coding in the previous section " box.showinfo "
_____________________________________________________________________________________________________

If this helps you, the error says " NameError: global name 'box' is not defined
Raspithon
:)

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Tkinter modules

Thu Aug 22, 2013 8:28 pm

something like this:

import tkMessageBox

tkMessageBox.showwarning(.....

http://effbot.org/tkinterbook/tkinter-s ... ialogs.htm for examples
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

Return to “Python”