Skip to content

Commit 89b49b6

Browse files
committedOct 19, 2023
Hello, my name is Ritik.
There are many possible upgrades that can be made to this project, as it is one of the best topics for research. I have already made some minor changes, including upgrading the GUI and adding a few new features. If you wanted more upgration you can inform me , i will do .
1 parent 7138061 commit 89b49b6

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed
 

‎WeatherApp.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import requests
33

44
root=Tk()
5+
root.title("Weather App")
6+
root.geometry("900x500+300+200")
7+
root.resizable()
58

69
def get(city):
710
api="79de5817a4d223b536ce61a0f630a4b4"
@@ -18,24 +21,39 @@ def show(report):
1821
city= report['name']
1922
weather_condition= report['weather'][0]['description']
2023
temp= report['main']['temp']
21-
output= 'City: %s \nCondition: %s \nTemperature(°C): %s' %(city,weather_condition,temp)
24+
pressure = report['main']['pressure']
25+
humidity = report['main']['humidity']
26+
wind = report['wind']['speed']
27+
output= 'City: %s \nCondition: %s \nTemperature(°C): %s \n Pressure: %s \n Humidity: %s \n wind: %s' %(city,weather_condition,temp,pressure,humidity,wind)
2228
except:
2329
output='Problem in show weather function'
2430
return output
2531

2632

33+
image_icon=PhotoImage(file="logo.png")
34+
root.iconphoto(False,image_icon)
35+
36+
#logo
37+
Logo_image=PhotoImage(file="logo2.png")
38+
logo=Label(image=Logo_image)
39+
logo.place(x=30,y=30)
40+
2741
canvas=Canvas(root,width=666,height=666)
2842
canvas.pack()
29-
43+
44+
3045

3146
frame=Frame(root,bd=1,bg='black')
3247
frame.place(relx=0.5,rely=0.1,relheight=0.1,relwidth=0.7,anchor='n')
3348

34-
entry=Entry(frame,font=('Helvetica',20),fg='white',bg='black')
49+
entry=Entry(frame,font=('Helvetica',20),fg='white',bg='#6e8084')
3550
entry.place(relheight=1,relwidth=0.7)
3651

37-
btn=Button(frame,text="Get Weather",bg="cyan",font=20,command=lambda: get(entry.get()))
38-
btn.place(relx=0.7,relheight=1,relwidth=0.3)
52+
Search_icon=PhotoImage(file="search_icon.png")
53+
myimage_icon=Button(frame,image=Search_icon,borderwidth=0,cursor="hand2",bg="lightblue",command=lambda: get(entry.get()))
54+
myimage_icon.place(relx=0.7,relheight=1,relwidth=0.3)
55+
56+
3957

4058
low_frame=Frame(root,bd=1)
4159
low_frame.place(relx=0.5,rely=0.3,relheight=0.6,relwidth=.75,anchor='n')

‎logo.png

32.5 KB
Loading

‎logo2.png

7.63 KB
Loading

‎search_icon.png

3.96 KB
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.