GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Basic-python-programs/TravelForm.py at main · Sbiswas001/Basic-python-programs

Expand file tree

/

TravelForm.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
35 lines (34 loc) · 1.63 KB
/

TravelForm.py

Copy path

File metadata and controls

35 lines (34 loc) · 1.63 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#TRAVEL FORM & Entry Widget
from tkinter import *
def getValue():
print("Submitting form...")
print(f"{name_val.get(),phone_val.get(),gender_val.get(),emergency_contact_val.get(),payment_mode_val.get(),foodservice_val.get()}")
with open("records.txt","a") as f:
f.write(f"{name_val.get(),phone_val.get(),gender_val.get(),emergency_contact_val.get(),payment_mode_val.get(),foodservice_val.get()}\n")
root=Tk()
root.geometry("310x270")
root.minsize(310,270)
root.maxsize(310,270)
root.title("travel Form")
Label(root,text="ABC Travel Agency",font=" helvetica 14 bold",pady=12).grid(row=0,column=3)
name_label=Label(root,text="Name:").grid(row=1)
phone_label=Label(root,text="Phone:").grid(row=2)
gender_label=Label(root,text="Gender:").grid(row=3)
emergency_contact_label=Label(root,text="Emergency Contact:").grid(row=4)
payment_mode_label=Label(root,text="Payment Mode:").grid(row=5)
name_val=StringVar()
phone_val=StringVar()
gender_val=StringVar()
emergency_contact_val=StringVar()
payment_mode_val=StringVar()
foodservice_val=IntVar()#for a check box
name_entry=Entry(root,textvariable=name_val).grid(row=1,column=3)
phone_entry=Entry(root,textvariable=phone_val).grid(row=2,column=3)
gender_entry=Entry(root,textvariable=gender_val).grid(row=3,column=3)
emergency_contact_entry=Entry(root,textvariable=emergency_contact_val).grid(row=4,column=3)
payment_mode_entry=Entry(root,textvariable=payment_mode_val).grid(row=5,column=3)
#checkboxes
foodservice_button=Checkbutton(text="Do you want food service?",variable=foodservice_val,pady=5).grid(row=6,column=3)
#submit button
Button(text="Submit",command=getValue).grid(row=7,column=3)
root.mainloop()
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.