This is an old revision of this page, as edited by 210.55.88.11 (talk) at 23:37, 22 June 2021 (yur). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Revision as of 23:37, 22 June 2021 by 210.55.88.11 (talk) (yur)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)] messages were the state of the art in rapid long-distance communication, elaborate systems of [[co
- my glossary project#
from tkinter import *
- key down function
def click():
entered_text=textentry.get() #this will collect the text form the text entry box output.delete(0.0, END) try: definition = my_compdictionary except: definition = "sorry there is no word like that please try again" output.insert(END, definition)
- main:
window = Tk() window.title("My computer Science Glassary") window.configure(background="black")
- My photo
photo1 = PhotoImage(file="me.gif") Label (window, image=photo1, bg="black") .grid(row=0, column=0, sticky=E)
- create label
Label (window, text="Enter the word you would a definition for:", bg="black", fg="white", font="none 12 bold") .grid(row=1, column=0, sticky=W)
- create a text entry box
textentry = Entry(window, width=20, bg="white") textentry.grid(row=2, column=0, sticky=W)
- add a submit button
Button(window, text="SUBMIT", width=6, comman=click) . grid(row=3, column=0, sticky=W)
- create another label
Label (window, text="\nDefiniition:", bg="black", fg="white", font="none 12 bold") .grid(row=4, column=0, sticky=W)
- create a text box
output = Text(window, width=75, height=6, wrap=WORD, background="white") output.grid(row=5, column=0, columnspan=2, sticky=W)
- the dictionary
my_compdictionary = {
'algorithm': 'Step by step instruction to complete a task', 'bug': 'piece of code causes a program to fail' }
- exit label
Label (window, text="click to exit:", bg="black", fg="white", font="none 12 bold") .grid(row=6, column=0, sticky=W)
- exit function
def close_window():
window.destroy() exit()
- add exit button
Button(window, text="Exit", width=14, comman=close_window) . grid(row=7, column=0, sticky=W)
- run the main loop
window.mainloop()#my glossary project#
from tkinter import *
- key down function
def click():
entered_text=textentry.get() #this will collect the text form the text entry box output.delete(0.0, END) try: definition = my_compdictionary except: definition = "sorry there is no word like that please try again" output.insert(END, definition)
- main:
window = Tk() window.title("My computer Science Glassary") window.configure(background="black")
- My photo
photo1 = PhotoImage(file="me.gif") Label (window, image=photo1, bg="black") .grid(row=0, column=0, sticky=E)
- create label
Label (window, text="Enter the word you would a definition for:", bg="black", fg="white", font="none 12 bold") .grid(row=1, column=0, sticky=W)
- create a text entry box
textentry = Entry(window, width=20, bg="white") textentry.grid(row=2, column=0, sticky=W)
- add a submit button
Button(window, text="SUBMIT", width=6, comman=click) . grid(row=3, column=0, sticky=W)
- create another label
Label (window, text="\nDefiniition:", bg="black", fg="white", font="none 12 bold") .grid(row=4, column=0, sticky=W)
- create a text box
output = Text(window, width=75, height=6, wrap=WORD, background="white") output.grid(row=5, column=0, columnspan=2, sticky=W)
- the dictionary
my_compdictionary = {
'algorithm': 'Step by step instruction to complete a task', 'bug': 'piece of code causes a program to fail' }
- exit label
Label (window, text="click to exit:", bg="black", fg="white", font="none 12 bold") .grid(row=6, column=0, sticky=W)
- exit function
def close_window():
window.destroy() exit()
- add exit button
Button(window, text="Exit", width=14, comman=close_window) . grid(row=7, column=0, sticky=W)
- run the main loop
window.mainloop()