From 9d1ef83e64c94138789e5a28aeb0e0177fb19b1e Mon Sep 17 00:00:00 2001 From: pk-png <64280551+pk-png@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:12:36 +0530 Subject: [PATCH 1/4] Update CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 09827eb16a5..8201658ce0b 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,4 +1,4 @@ -# Contributor Covenant Code of Conduct +# Contributor Covenant Code of Conduct Easy to understand ## Our Pledge From 43de1b81c24169cb09035fecf4ce8095287074c4 Mon Sep 17 00:00:00 2001 From: pk-png <64280551+pk-png@users.noreply.github.com> Date: Sat, 3 Oct 2020 12:59:36 +0530 Subject: [PATCH 2/4] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9f1ab7baf14..dcc63139b58 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing +# Contributing Notepad Project When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. From 43dd56ebb3c672a808099da433ba3e70e704c4cc Mon Sep 17 00:00:00 2001 From: pk-png <64280551+pk-png@users.noreply.github.com> Date: Sat, 3 Oct 2020 13:02:51 +0530 Subject: [PATCH 3/4] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dcc63139b58..24cde27bebc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing Notepad Project +# Contributing Notepad Sorting When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. From c6494fc645c47814dcaa25358faf3b6676268a82 Mon Sep 17 00:00:00 2001 From: Prashant <64280551+pk-png@users.noreply.github.com> Date: Sat, 3 Oct 2020 19:07:53 +0530 Subject: [PATCH 4/4] Added Age Calculate --- agecalculator.py | 69 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 agecalculator.py diff --git a/agecalculator.py b/agecalculator.py new file mode 100644 index 00000000000..094aa88ca46 --- /dev/null +++ b/agecalculator.py @@ -0,0 +1,69 @@ +from _datetime import datetime +import tkinter as tk +from tkinter import ttk +from _datetime import * + +win = tk.Tk() +win.title('Age Calculate') +win.geometry('310x400') +# win.iconbitmap('pic.png') this is use extention ico then show pic + +############################################ Frame ############################################ +pic = tk.PhotoImage(file=r"E:\Python Practice\Age_calculate\pic.png") +win.tk.call('wm','iconphoto',win._w,pic) + + +canvas=tk.Canvas(win,width=310,height=190) +canvas.grid() +image = tk.PhotoImage(file=r"E:\Python Practice\Age_calculate\pic.png") +canvas.create_image(0,0,anchor='nw',image=image) + +frame = ttk.Frame(win) +frame.place(x=40,y=220) + + + +############################################ Label on Frame ############################################ + +name = ttk.Label(frame,text = 'Name : ',font = ('',12,'bold')) +name.grid(row=0,column=0,sticky = tk.W) + +year = ttk.Label(frame,text = 'Year : ',font = ('',12,'bold')) +year.grid(row=1,column=0,sticky = tk.W) + +month = ttk.Label(frame,text = 'Month : ',font = ('',12,'bold')) +month.grid(row=2,column=0,sticky = tk.W) + +date = ttk.Label(frame,text = 'Date : ',font = ('',12,'bold')) +date.grid(row=3,column=0,sticky = tk.W) + +############################################ Entry Box ############################################ +name_entry = ttk.Entry(frame,width=25) +name_entry.grid(row=0,column=1) +name_entry.focus() + +year_entry = ttk.Entry(frame,width=25) +year_entry.grid(row=1,column=1,pady=5) + +month_entry = ttk.Entry(frame,width=25) +month_entry.grid(row=2,column=1) + +date_entry = ttk.Entry(frame,width=25) +date_entry.grid(row=3,column=1,pady=5) + + +def age_cal(): + name_entry.get() + year_entry.get() + month_entry.get() + date_entry.get() + cal = datetime.today()-(int(year_entry)) + print(cal) + + +btn = ttk.Button(frame,text='Age calculate',command=age_cal) +btn.grid(row=4,column=1) + + + +win.mainloop()