画像のような為替変換を行いたいのですが、うまく機能しません。画像の挿入方法もわかりません。
ご指摘、改善点お願いします。
import tkinter
import tkinter.messagebox
root=tkinter.Tk()
def convert():
if radio_var.get() == 1: #chinese Yuan
AusDollar = round(entry_var.get() * 0.209234,0)
tkinter.messagebox.showinfo('Your ',str(entry_var), 'Chinese Yuan = ',str(AusDollar), ' in Australian Dollars')
elif currency.upper() == 2: #Euro
AusDollar = round(entry_var.get() * 1.59524,0)
tkinter.messagebox.showinfo('Your ',str(entry_var), 'Euros = ',str(AusDollar), ' in Australian Dollars')
elif currency.upper() == 3: #British Pound
AusDollar = round(entry_var.get * 1.83338,0)
tkinter.messagebox.showinfo('Your ',str(entry_var), 'British Pounds = ',str(AusDollar), ' in Australian Dollars')
elif currency.upper() == 4: #Russian Ruble
AusDollar = round(entry_var.get * 0.0214580,0)
tkinter.messagebox.showinfo('Your ',str(entry_var), 'Russian Rubles = ',str(AusDollar), ' in Australian Dollars')
main_frame = tkinter.Frame(root).grid()
radio_var = tkinter.IntVar()
radio_var.set(1)
entry_var = tkinter.IntVar()
#create butons
tkinter.Label(main_frame, text = "please select the currency to convert").grid(column=1, row=1)
tkinter.Radiobutton(main_frame, text="Chinese Yuan", variable=radio_var,
value=1).grid(column=1, row=2)
tkinter.Radiobutton(main_frame, text="Euro", variable=radio_var,
value=2).grid(column=1, row=3)
tkinter.Radiobutton(main_frame, text="British pound", variable =radio_var,
value=3).grid(column=1, row=4)
tkinter.Radiobutton(main_frame, text="Russian Ruble", variable=radio_var,
value=4).grid(column=1, row=5)
tkinter.Label(main_frame, text="How much money do you want to convert?:").grid(column=1, row=7)
tkinter.Entry(main_frame, textvariable= entry_var, width=10).grid(column=2, row=7)
tkinter.Button(main_frame,
text="Convert", command=convert).grid(column=1, row=8)
quit_button=tkinter.Button(main_frame, text ="Quit", command=root.destroy).grid(column=2, row=8)
tkinter.mainloop()