[DB-SIG] Front end GUI to database

Duane Hennessy duaneh@connexus.net.au
Thu, 13 Feb 2003 13:52:46 +1100


Hi,
    I've made a Tkinter GUI front end to my database. There are two forms, a
menu form and a database form, both tested and work fine. The issue is how
to open the database form from the menu form more than once. I tried
importing the database form in code which works fine the first time but from
then on if I close the database form I can't reopen it again. Does anyone
have any ideas....

The location of the forms are at:
main menu form  'c:\python22\pmain_menu.pyw'
database form  'c:\python22\lottery_predict\prediction_history.pyw'

OS: is Windows XP and 2000

System: Python 2.2

Code in Main menu form is as follows:

--start--

###
# Program: Lottery_Predictor
# Class: pmain_menu
# Author: Duane Hennessy, Australia
###

from Tkinter import *
import tkMessageBox as msgbox
import tkFont

def open_history_form():
    global predict_form
    import lottery_predict.prediction_history as predict_form  # this is
where I open the database form.


def testit():
    msgbox.showinfo('Test Messages','Exiting')
    sys.exit()

# create font for form label etc.
#header_font = tkFont.Font(family='arial', size=15, weight=tkFont.BOLD,
underline=1)
root = Tk()
Label(root, text = 'Lottery Predictor Main Menu').grid(row=1,sticky=W)
Button(root, text='Past Predictions', width=15,
command=open_history_form).grid(row=2,sticky=W)
Button(root, text='Close', width=15, command=testit).grid(row=3,sticky=W)
Label(root).grid(row=4,sticky=W)
root.mainloop()

--end--

tia Duane.