###Describing the worlds Problems### ###by Davi Silveira### from tkinter import * import thesaurus as th class Color: PURPLE = '\033[95m' CYAN = '\033[96m' DARKCYAN = '\033[36m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BOLD = '\033[1m' UNDERLINE = '\033[4m' END = '\033[0m' window = Tk() window.title("Probably Not".center(150)) window.configure(background='#F9FBFD') window.geometry('600x880') top_frame = Frame(window) top_frame.pack(side=TOP) bottom_frame = Frame(window) bottom_frame.pack(side=BOTTOM) def save_me(event): pass def eval_me(event): entered_text = sentence.get() entered_word = word_to_replace.get() output.delete(0.0, END) while True: synonyms = th.Word(entered_word).synonyms(0) for words in synonyms: screen_print = entered_text.replace(entered_word, words) output.insert(END, screen_print + '\n') break top_bg = PhotoImage(file="bg.png") Label(top_frame, image=top_bg, height=200, bg="black").pack() ## Intro main_title = Label(top_frame, text="HOW TO DEFINE A PROBLEM", bg="#F9FBFD", fg="#254051", font="'Lato 18 bold") main_title.pack(fill=X) ## Quote quote = Label(top_frame, text="Einstein is reported to have said that if he only had one\n " "hour to save the world he would spend 55 minutes defining the\n " "problem and 5 minutes solving it.", font='Lato 10', bg="#F9FBFD", fg="black", width=10) quote.pack(fill=X) ## Quote2 quote2 = Label(top_frame, text="Keep it simple\n " "\n'Increase Sales' 'Be Productive' 'More Will Power'\n " "Rephrasing a problem can help you better\n " "understand it from different angles.", font='Lato 10 bold', bg="#F9FBFD", fg="black", width=10) quote2.pack(fill=X) ### BLANK SPACE### ### BLANK SPACE### blank_space2 = Label(bottom_frame, height=1, bg="#F9FBFD", fg="#95B4D8") blank_space2.pack(fill=X) ### BLANK SPACE### ### BLANK SPACE### ## Label main_line = Label(top_frame, text="Define a Problem", bg="#F9FBFD", fg="#254051", font="'Lato 12 bold") main_line.pack(fill=X) ## text entry box sentence = Entry(top_frame, width=40, bg="#F9FBFD", fg="black", font='Lato 14') sentence.pack() ## Label second_main_line = Label(bottom_frame, text="Rephrase which word?", bg="#F9FBFD", fg="#254051", font="'Lato 12 bold") second_main_line.pack(fill=X) ## text entry box word_to_replace = Entry(bottom_frame, width=40, bg="#F9FBFD", fg="#3567ee", font='Lato 14 bold') word_to_replace.pack() ## Button b = Button(bottom_frame, text="Probably Not!") b.bind("<Button-1>", eval_me) b.pack(fill=X) ## OUTPUT output = Text(bottom_frame, width=40, height=20, wrap=WORD, background="white") output.pack(fill=X) # ###BLANK SPACE### # blank_space1 = Label(bottom_frame, height=20, bg="#F9FBFD", fg="#95B4D8") # blank_space1.pack(fill=X) # ###BLANK SPACE### ## control panel control = Button(bottom_frame, text="Save Result", height=0, fg="black") control.bind("<Button-1>", save_me) control.pack(fill=X) ### BLANK SPACE### blank_space1 = Label(bottom_frame, height=1, bg="#F9FBFD", fg="#95B4D8") blank_space1.pack(fill=X) ### BLANK SPACE### window.mainloop()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question