初質問の初心者です。よろしくお願いいたします。
実現したいこと
各国通貨を1ユーロ当たりの値に変換するアプリをTkinterで作成
発生している問題・エラーメッセージ
http://www.floatrates.com/daily/eur.json
上記のjsonを使用して、変換を行う関数とその結果を反映するところがまだ理解しておらず、手が止まっております。
該当のソースコード
python
1import tkinter as tk 2import tkinter.ttk as ttk 3from turtle import back 4 5win = tk.Tk() 6win.geometry('500x400') 7win.config(bg='lightgray') 8win.title('FX Lookup') 9 10label1 = tk.Label(win, text='Exchange Rate Lookup | Show exchange rates from EUR to various other currencies.', font=('Basic', 13), background='lightgray', wraplength=450, justify='left') 11label1.place(x=10, y=30) 12 13label2 = tk.Label(win, text='Example currency symbols: USD, HKD, INR, GBP, ...', font=('Basic', 13), background='lightgray') 14label2.place(x=10, y=95) 15 16separator_gray = ttk.Separator(win, style="gray.TSeparator", orient='horizontal') 17separator_gray.pack(padx=10, pady=160, fill='x') 18 19label3 = tk.Label(win, text='Currency symbol', font=('Basic', 13), background='lightgray') 20label3.place(x=175, y=170) 21 22label4 = tk.Label(win, text='1 EUR = ', background='lightgray', font=('Basic', 13)) 23label4.place(x=220, y=200) 24 25label5 = tk.Label(win, text=str(0), font=('Basic', 13), background='lightgray') 26label5.place(x=400, y=200) 27 28 29def convert(): 30 pass 31 32 33txtBox = tk.Entry(width=22, font=('Basic', 13)) 34txtBox.place(x=10, y=200) 35 36button = tk.Button(text="Lookup", command=convert, width=52, background='lightgray', font=('Basic', 13)) 37button.place(x=10, y=230) 38 39win.mainloop()
補足情報
python 3.10.4
Visual Studio Code 1.66.0
Windows 11
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/03/31 19:09