Skip to content

Commit a97d18a

Browse files
Merge pull request #942 from Codes-Talent/master
Improve Docs
2 parents 86f34a6 + c6494fc commit a97d18a

File tree

3 files changed

+71
-2
lines changed

3 files changed

+71
-2
lines changed

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributor Covenant Code of Conduct
1+
# Contributor Covenant Code of Conduct Easy to understand
22

33
## Our Pledge
44

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing
1+
# Contributing Notepad Sorting
22

33
When contributing to this repository, please first discuss the change you wish to make via issue,
44
email, or any other method with the owners of this repository before making a change.

agecalculator.py

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
from _datetime import datetime
2+
import tkinter as tk
3+
from tkinter import ttk
4+
from _datetime import *
5+
6+
win = tk.Tk()
7+
win.title('Age Calculate')
8+
win.geometry('310x400')
9+
# win.iconbitmap('pic.png') this is use extention ico then show pic
10+
11+
############################################ Frame ############################################
12+
pic = tk.PhotoImage(file=r"E:\Python Practice\Age_calculate\pic.png")
13+
win.tk.call('wm','iconphoto',win._w,pic)
14+
15+
16+
canvas=tk.Canvas(win,width=310,height=190)
17+
canvas.grid()
18+
image = tk.PhotoImage(file=r"E:\Python Practice\Age_calculate\pic.png")
19+
canvas.create_image(0,0,anchor='nw',image=image)
20+
21+
frame = ttk.Frame(win)
22+
frame.place(x=40,y=220)
23+
24+
25+
26+
############################################ Label on Frame ############################################
27+
28+
name = ttk.Label(frame,text = 'Name : ',font = ('',12,'bold'))
29+
name.grid(row=0,column=0,sticky = tk.W)
30+
31+
year = ttk.Label(frame,text = 'Year : ',font = ('',12,'bold'))
32+
year.grid(row=1,column=0,sticky = tk.W)
33+
34+
month = ttk.Label(frame,text = 'Month : ',font = ('',12,'bold'))
35+
month.grid(row=2,column=0,sticky = tk.W)
36+
37+
date = ttk.Label(frame,text = 'Date : ',font = ('',12,'bold'))
38+
date.grid(row=3,column=0,sticky = tk.W)
39+
40+
############################################ Entry Box ############################################
41+
name_entry = ttk.Entry(frame,width=25)
42+
name_entry.grid(row=0,column=1)
43+
name_entry.focus()
44+
45+
year_entry = ttk.Entry(frame,width=25)
46+
year_entry.grid(row=1,column=1,pady=5)
47+
48+
month_entry = ttk.Entry(frame,width=25)
49+
month_entry.grid(row=2,column=1)
50+
51+
date_entry = ttk.Entry(frame,width=25)
52+
date_entry.grid(row=3,column=1,pady=5)
53+
54+
55+
def age_cal():
56+
name_entry.get()
57+
year_entry.get()
58+
month_entry.get()
59+
date_entry.get()
60+
cal = datetime.today()-(int(year_entry))
61+
print(cal)
62+
63+
64+
btn = ttk.Button(frame,text='Age calculate',command=age_cal)
65+
btn.grid(row=4,column=1)
66+
67+
68+
69+
win.mainloop()

0 commit comments

Comments
 (0)