Hey guys, I've started using Tkinter now and I've came across a problem...Here in the code below i just want a drop box style menu to appear and when i click that option, theres more options. When i click for example their would be a box called Addition, you would click it and it would say Goto Addition, and when you click it, it will execute that choice in the shell. Heres what I've started on:
from Tkinter import *
root = Tk()
#The options box
menubar = Menu(root)
filemenu = Menu(menubar, tearoff=0)
filemenu.add(label="Addition", command='1')
filemenu.add(label="Subtraction, command='2')
filemenu.add_seperator()
root.config(menu=menubar)
mainloop()
#The Start of the calculator
a = 0
def menu():
print "1) Addition"
print "2) Subtraction"
print ""
print "3) Multiplication"
print "4) Division"
print ""
print "5) Exponets"
while a == 0:
menu()
a = int(raw_input("Choose your option: "))
if a == 1:
x = 0
number = int(raw_input("Add this: "))
while x == 0:
number1 = int(raw_input("By this: "))
number2 = number+number1
print number2
x+=1
if x == 1:
a = 0
elif a == 2:
x = 0
number3 = int(raw_input("Subtract this: "))
while x == 0:
number4 = int(raw_input("By this: "))
number5 = number3-number4
print number5
x+=1
if x == 1:
a = 0
elif a == 3:
x = 0
number6 = int(raw_input("Multiply this: "))
while x == 0:
number7 = int(raw_input("By this: "))
number8 = number6*number7
print number8
x+=1
if x == 1:
a = 0
elif a == 4:
x = 0
number9 = int(raw_input("Divide this: "))
while x == 0:
number10 = int(raw_input("By this: "))
number11 = number9/number10
print number11
x+=1
if x == 1:
a = 0
elif a == 5:
x = 0
number12 = int(raw_input("Exponet1: "))
while x == 0:
number13 = int(raw_input("Exponet2: "))
number14 = number12**number13
print number14
x+=1
if x == 1:
a = 0