Question: #pip install tkinter import tkinter as tk from tkinter import * import tkinter.messagebox #GUI root = tk . Tk ( ) root.title ( Currency
#pip install tkinter
import tkinter as tk
from tkinter import
import tkinter.messagebox
#GUI
root tkTk
root.titleCurrency converter:"
Tops Frameroot bg #eee pady width height relief"ridge"
Tops.gridrow column
headlabel tkLabelTops fontlato black', 'bold' text'Currency converter :
bg#eee fg'black'
headlabel.gridrow column stickyW
variable tkStringVarroot
variable tkStringVarroot
variablesetcurrency
variablesetcurrency
#Function To For Real Time Currency Conversion
def RealTimeCurrencyConversion:
from forexpython.converter import CurrencyRates
c CurrencyRates
fromcurrency variableget
tocurrency variableget
if Amountfield.get:
tkinter.messagebox.showinfoError "Amount Not Entered.
Please a valid amount."
elif fromcurrency "currency" or tocurrency "currency":
tkinter.messagebox.showinfoError
"Currency Not Selected.
Please select FROM and TO Currency form menu."
else:
newamt cconvertfromcurrency, tocurrency, floatAmountfield.get
newamount float:fformatnewamt
Amountfield.insert strnewamount
#clearing all the data entered by the user
def clearall:
Amountfield.delete tkEND
Amountfield.delete tkEND
CurrenyCodelist INR "USD", "CAD", CNYDKK "EUR"
root.configurebackground#eee
root.geometryx
Label Labelroot fontlato black', 'bold' text padx pady bg#eee fg"black"
Labelgridrow column stickyW
label tkLabelroot fontlato black', 'bold' textt Amount : bg#eee fg"black"
labelgridrow column stickyW
label tkLabelroot fontlato black', 'bold' textt From Currency : bg#eee fg"black"
labelgridrow column stickyW
label tkLabelroot fontlato black', 'bold' textt To Currency : bg#eee fg"black"
labelgridrow column stickyW
label tkLabelroot fontlato black', 'bold' textt Converted Amount : bg#eee fg"black"
labelgridrow column stickyW
Label Labelroot fontlato black', 'bold' text padx pady bg#eee fg"black"
Labelgridrow column stickyW
Label Labelroot fontlato black', 'bold' text padx pady bg#eee fg"black"
Labelgridrow column stickyW
FromCurrencyoption tkOptionMenuroot variableCurrenyCodelist
ToCurrencyoption tkOptionMenuroot variableCurrenyCodelist
FromCurrencyoption.gridrow column ipadx stickyE
ToCurrencyoption.gridrow column ipadx stickyE
Amountfield tkEntryroot
Amountfield.gridrow column ipadx stickyE
Amountfield tkEntryroot
Amountfield.gridrow column ipadx stickyE
Label Buttonroot fontarial 'bold' text Convert padx pady bg"lightblue", fg"white",
commandRealTimeCurrencyConversion
Labelgridrow column
Label Labelroot fontlato black', 'bold' text padx pady bg#eee fg"black"
Labelgridrow column stickyW
Label Buttonroot fontarial 'bold' text Clear All padx pady bg"lightblue", fg"white",
commandclearall
Labelgridrow column
root.mainloop
in the above python code the output is displaying by not converting the amount check the error and solve it if solved tell me the errors.if the code is correct i will give you a big thumbsup Thank you
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
