Тёмный

Build a Weather app with Python and Tkinter 

Catalin tech
Подписаться 2,9 тыс.
Просмотров 36 тыс.
50% 1

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 90   
@UCMENOTx
@UCMENOTx 4 года назад
Great video, but I noticed that your API key is showing at 17:04 in the console. Just in case you haven’t deleted the key already 😅
@mattrieckenberg
@mattrieckenberg 4 года назад
I'm getting the same errors as everyone else with the icons. Also why did we use 'final' in the function definition but use 'weather' elsewhere?
@gamingshubhamsamanta
@gamingshubhamsamanta 3 года назад
you are doing nice coding and its really awesome like computer application
@ScarRackz
@ScarRackz 3 года назад
CAN SOMEONE COPY AND PASATE THE CODE FOR THIS?
@yasinrezvani2539
@yasinrezvani2539 3 года назад
This content is such a perfect, Thank you so much
@KulwinderKaur-kl4sw
@KulwinderKaur-kl4sw 3 года назад
How to show icon? I get error
@jakes-dev1337
@jakes-dev1337 2 года назад
If you are getting the error 'list indices must be integers or slices, not str' for any of the ['weather'] json formatting, instead of: icon = json['weather']['main'] use: icon = json['weather'][0]['main'] They must have change the format of the json file.
@bigtomDW
@bigtomDW Год назад
literally rewrote everything 4 times, line for line and it don't run properly... I'm sooo confused
@nplfanszonefootballhighlig5200
@nplfanszonefootballhighlig5200 Месяц назад
It said no module like configParser,
@1hunnit994
@1hunnit994 4 года назад
how to fix this? _tkinter.TclError: bitmap "weather_icons/04d.png" not defined
@michelnaouss748
@michelnaouss748 4 года назад
Make sure the image is in the same directory as your python sxroy
@michelnaouss748
@michelnaouss748 4 года назад
Script*
@theglammcoder
@theglammcoder 4 года назад
@@michelnaouss748 still getting the same errror
@michelnaouss748
@michelnaouss748 4 года назад
Make the image global.
@michelnaouss748
@michelnaouss748 4 года назад
@@theglammcoder when making an image variable always make it global in tkinter it causes many errors
@parneetkaur6860
@parneetkaur6860 2 года назад
why is result.content used and not just result? could you please explain
@jakes-dev1337
@jakes-dev1337 2 года назад
such a great tutorial but icon isnt working.
@suryavamsichilukuri7475
@suryavamsichilukuri7475 3 года назад
How to get that window that show all weather
@educationunplugged464
@educationunplugged464 4 года назад
bitmap not workoing
@sethmedina5774
@sethmedina5774 4 года назад
Just had that issue
@nirmalbhattarai1343
@nirmalbhattarai1343 Год назад
@@sethmedina5774 haha yes brother
@ztrixx3280
@ztrixx3280 3 года назад
bitmap doesn't work!!!!
@mikailakintunde3699
@mikailakintunde3699 4 года назад
Hi, i try to run the code but i got error.. Do i have to install tkinter on my python command prompt first? I looked for the video, i didn't find it.. pls help. thanks
@ragreenburg
@ragreenburg 4 года назад
Yes you have to have Tkinter installed. What OS are you running?
@theglammcoder
@theglammcoder 4 года назад
_tkinter.TclError: bitmap "weather_iocns/09n.png" not defined getting this error can anyone help me with it ??
@engineerstrange7381
@engineerstrange7381 4 года назад
Same problem.... Did you fixed it?
@egymatrixx
@egymatrixx 4 года назад
I got the same error, did you fix this?
@coder5429
@coder5429 4 года назад
thanks for the nice tutorial, I liked it
@krom09
@krom09 3 года назад
For those not able to get 'bitmap' to work I manage to make it work with this change: icon_ref = PhotoImage(file='folderwhereiconislocated/{}.png'.format(weather[3])) image['image'] = icon_ref image.image = icon_ref # must keep a reference of icon or else image will be transparent # change option to 'image' inside Label image = Label(app, image='') effbot.org/pyfaq/why-do-my-tkinter-images-not-appear.htm#:~:text=When%20you%20add%20a%20PhotoImage,won't%20always%20show%20up.&text=When%20Python's%20garbage%20collector%20discards,Tk%20to%20release%20the%20image.
@habui2652
@habui2652 2 года назад
Thank you! Your comment is super helpful!
@leonardomino7823
@leonardomino7823 3 года назад
good video, can you pass the code?
@harshsaraswat247
@harshsaraswat247 4 года назад
key_error: 'api_key' anybody knows how to solve it
@michelangelodebaggis8471
@michelangelodebaggis8471 4 года назад
Same error, did you solve it?
@harshsaraswat247
@harshsaraswat247 4 года назад
@@michelangelodebaggis8471 Nope
@harshsaraswat247
@harshsaraswat247 4 года назад
@@michelangelodebaggis8471 I think we have to create our own api key
@michelangelodebaggis8471
@michelangelodebaggis8471 4 года назад
I changed the directory and it worked
@harshsaraswat247
@harshsaraswat247 4 года назад
@@michelangelodebaggis8471 ok.. I will try it as well.. Thank you
@matekezherashvili5461
@matekezherashvili5461 4 года назад
YEA BUT HOW TO LOAD PNG FILE WITH ICON? IT SHOWS ME ERROR WHILE COPYING IT
@infinitygaming2077
@infinitygaming2077 3 года назад
same
@Steven-jf4cs
@Steven-jf4cs 2 года назад
Thanks! much - quick easy and efficient Sir :)
@ayomidejayeola2369
@ayomidejayeola2369 7 месяцев назад
What if you are using idle
@johnteologo2201
@johnteologo2201 4 года назад
bitmap is not working I need help!
@infinitygaming2077
@infinitygaming2077 3 года назад
same
@generalpinochet9821
@generalpinochet9821 4 года назад
can you share the source code
@Santiago-xb7tn
@Santiago-xb7tn 2 года назад
help you know because I get this mistake tkinter. TclError: bitmap "weather_icons/04n.png" not defined
@kesondrakey9927
@kesondrakey9927 2 года назад
I can't get this to work for the life of me. 4 hours later and still no luck. so many TCL errors. Is there anywhere I could see the entire code that actually use the weather icons???
@geridashja3270
@geridashja3270 3 года назад
***For those who are having problems with icons!*** What I did is that I created a "global img" inside the Search() function. After that, I set the "file" section of the img to the icon given from the API: img["file"] = 'your file location\\{}.png'.format(weather[4]) Then I avoided using bitmap. Instead of bitmap I used image. img = PhotoImage(file= " ") Image = Label(root, image = img) Image.pack()
@faxmunke9763
@faxmunke9763 3 года назад
Thank you, Geri!!!! It finally worked, ich küsse dein Auge
@ashokkumarmishra5664
@ashokkumarmishra5664 3 года назад
Please paste the complete code
@chaplinshow4153
@chaplinshow4153 3 года назад
@@ashokkumarmishra5664 in - def search() - img["file"] = 'your file location\\{}.png'.format(weather[4]) after - location_lbl = Label(app, ...... img = PhotoImage(file="") Image = Label(app, image=img) Image.pack()
@lovatzen5514
@lovatzen5514 3 года назад
i dont get it still now , i try in this way but dont work.just got TclError. May u share me your full code for img?
@geridashja3270
@geridashja3270 3 года назад
@@lovatzen5514 def search(): global img if weather: img["file"] = 'weather_app\\icons\\{}.png'.format(weather[4]) def get_infos(city): result = requests.get(url.format(city, get_api())) if result: json = result.json() icon = json["weather"][0]["icon"] final = (city, country, temp_celsius, temp_far, icon, weather) return final else: return None img = PhotoImage(file= "") Image = Label(root, image = img) Image.pack()
@4EntertainmentOnly
@4EntertainmentOnly 2 года назад
My solution to the bitmap problem was just to comment it out and not use those commands.
@razarizvi7085
@razarizvi7085 Год назад
Really helped a lot, lots of love and respect from Pakistan❤
@pp-vw5jh
@pp-vw5jh 3 года назад
Please help the bitmap images don't work
@abhinav3574
@abhinav3574 3 года назад
plz help i got keyerror:'api_key'
@muradkuriev
@muradkuriev Год назад
what to do he can't find png???
@lakshay3642
@lakshay3642 3 года назад
is the api key is free or it charges money
@suhashanjar6820
@suhashanjar6820 3 года назад
Plz reply....IS JSON used in this??????
@adithyaramula16
@adithyaramula16 3 года назад
image not working...
@xancatLoL
@xancatLoL 4 года назад
I'm not sure how to fix the .png error everyone is getting as well...
@blakspectr1366
@blakspectr1366 3 года назад
use pillow module and convert .png to .jpeg... this will surely work
@suvamgupta564
@suvamgupta564 3 года назад
thank you so much
@blizrav01
@blizrav01 4 года назад
great tutorial
@amansharma7296
@amansharma7296 4 года назад
I am getting tinter tcl error bitmap image/50d not defined
@1hunnit994
@1hunnit994 4 года назад
same error
@Farhan-pn1hg
@Farhan-pn1hg 4 года назад
Same error here
@ImTheMrFoxman
@ImTheMrFoxman 4 года назад
@@Farhan-pn1hg he didn't do this in the video where I'm at so far, but the icons default save as 50d@2x.png. You gotta add the @2x part after {} and before .png in the code.
@theglammcoder
@theglammcoder 4 года назад
@@ImTheMrFoxman did this still getting the same error
@valentindinu2489
@valentindinu2489 4 года назад
@@theglammcoder Did you find any solution for that problem ?
Далее
Working with Dictionaries in Python
17:29
Просмотров 231
How to Program a GUI Application (with Python Tkinter)!
1:05:14
100 Identical Twins Fight For $250,000
35:40
Просмотров 32 млн
Kenji's Sushi Shop Showdown - Brawl Stars Animation
01:55
11 ming dollarlik uzum
00:43
Просмотров 391 тыс.
Build a Weather App - Python Tkinter GUI Tutorial #24
22:57
Professional Weather App with Django in Python
42:33
Просмотров 46 тыс.
How To Create Apps In Python Using Tkinter!
17:50
Просмотров 56 тыс.
Being Competent With Coding Is More Fun
11:13
Просмотров 80 тыс.
Using docker in unusual ways
12:58
Просмотров 450 тыс.
The pack layout method in tkinter
23:50
Просмотров 14 тыс.
100 Identical Twins Fight For $250,000
35:40
Просмотров 32 млн