in this project we will learn how to design a form to collect Date of Birth information.
Below code will design the above form
#program
try:
from Tkinter import *
except:
from tkinter import *
mw = Tk()
mw.geometry("600x100+50+50")
mw.title("AETies : Automation Expert Technologies")
hdng = Label(mw, text='A simple format of REGISTRATION FORM ', fg='blue', pady=10).pack()
# ********** designing date of birth section **********
dob_l = Label(mw, text='D.O.B(dd/mm/yyyy) :\t', ).place(x=10, y=50)
dd = Spinbox(mw, from_=1, to=31, width=3).place(x=180, y=50)
mm = Spinbox(mw, from_=1, to=12, width=3).place(x=240, y=50)
yy = Spinbox(mw, from_=1965, to=2020, width=5).place(x=300, y=50)
mainloop()
Now let's add a functionality to collect the selected value in date of birth field. value can either be changed by clicking on arrow or directly we can edit.
#program
try:
from Tkinter import *
except:
from tkinter import *
def collect_data():
print('date :', dd.get())
print('month:', mm.get())
print('year :', yy.get())
mw = Tk()
mw.geometry("600x100+50+50")
mw.title("AETies : Automation Expert Technologies")
hdng = Label(mw, text='A simple format of REGISTRATION FORM ', fg='blue', pady=10).pack()
# ********** designing date of birth section **********
dob_l = Label(mw, text='D.O.B(dd/mm/yyyy) :\t', ).place(x=10, y=50)
dd = Spinbox(mw, from_=1, to=31, width=3)
dd.place(x=180, y=50)
mm = Spinbox(mw, from_=1, to=12, width=3)
mm.place(x=240, y=50)
yy = Spinbox(mw, from_=1965, to=2020, width=5)
yy.place(x=300, y=50)
btn = Button(mw, text=' collect ', fg='red', command=collect_data).place(x=400, y=50)
mainloop()
#Output
date : 5
month: 8
year : 1990
UlaecilYterpze_Lafayette Brandi Sampy https://marketplace.visualstudio.com/items?itemName=7hiatenoda.Descargar-Clownfield-2042-gratuita
ReplyDeleteinavifchar
Uhiaranre-nu David Vasquez download
ReplyDeletehttps://colab.research.google.com/drive/1aUmZkX-861CjA6esZmtzuw1PFclEqGrk
click
link
kimarpaycep
sculbalim-su Rama Gardner Install
ReplyDeleteCheck
Link
venbemave
tarabifu Brittany Owens JetBrains PyCharm Professional 2022.2
ReplyDeleteFreemake Video Converter 4.1.13.126
Retouch4me Heal
FixMeStick
nernykafas
nestconAin_bu Alyssa Johnson there
ReplyDeleteprograms
itcherafes