Gui in Python 3.3? -


i make menu program in form of gui user can select want clicking on box instead of typing in number / letter. got far:

while true:     encrypt = false     decrypt = false     viewz = false     errorz = false     inp = input("do want [e]ncode, [d]ecode, [v]iew code or [ex]it:")     inp = inp.lower()     if (inp != "e"  , inp != "d" , inp != "encode" , inp != "decode" , inp != "v" , inp != "view code" ):         print("input error")         print()         continue     if inp == "e" or inp == "encode":         encrypt = true     if inp == "d" or inp == "decode":         decrypt = true 

here tkinter example python 3.3 on windows. not entirely sure going hope helps.

import tkinter tk  window = tk.tk()  encrypt = false decrypt = false viewz = false errorz = false # not sure why had this, included may handy  def encode():     encrypt = true     window.destroy()  def decode():     decrypt =true     window.destroy()  def viewcode():     viewz = true # think going here?     window.destroy()  def exit():     window.destroy() # assuming want exit button exit tk window  label = tk.label(text = "do want to:") encodebutton = tk.button(text = "encode", command = encode) decodebutton = tk.button(text = "decode", command = decode) viewcodebutton = tk.button(text = "view code", command = viewcode) exitbutton = tk.button(text = "exit", command = exit) # theres heaps more can tkinter, google , give go it's heaps of   fun. label.pack() encodebutton.pack() decodebutton.pack() viewcodebutton.pack() exitbutton.pack()  window.mainloop() # after go on code :p 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -