Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 332c979

Browse files
Merge pull request #5 from sg23600/main
set 2 GUI
2 parents 2a7a88b + 5a92ee9 commit 332c979

File tree

1 file changed

+137
-0
lines changed

1 file changed

+137
-0
lines changed

‎Week 4/set2.py‎

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
from tkinter import *
2+
import tkinter as tk
3+
from tkinter import ttk
4+
from tkinter import filedialog
5+
import os
6+
7+
window = Tk()
8+
window.title("Information")
9+
window.geometry("{0}x{0}+0+0".format(window.winfo_screenwidth(), window.winfo_screenheight()))
10+
Label(window,text="Job Application",font=('Helvetica 28 bold'),fg="black").place(relx=0.5, rely=0.03,anchor=CENTER)
11+
Label(window,text="Personal Information", font="Helvetica 16 bold",fg="red").grid(row=1,column=1,pady=(80,20))
12+
Label(window,text="Name: ", font="Helvetica 14").grid(row=2,column=1)
13+
14+
def Submit():
15+
window.destroy()
16+
17+
#opening second window
18+
window2 = Tk()
19+
window2.title("Information Submitted")
20+
window2.geometry("{0}x{0}+0+0".format(window2.winfo_screenwidth(), window2.winfo_screenheight()))
21+
22+
#window2 Content
23+
Label(window2,text="Information Submitted,Thank You!",font='Helvetica', padx=10, pady=20,bg="black", fg="white").place(relx=0.5, rely=0.5, anchor=CENTER)
24+
Label(window2,text="Made By Vedansh Vijaywargiya - RA1911003010203",font='Helvetica', padx=10, pady=20,bg="black", fg="white").place(relx=0.37, rely=0.88)
25+
26+
text1 = Entry(window,width=40)
27+
text1.insert(0,'First Name')
28+
text1.grid(row=2,column=2)
29+
30+
text2 = Entry(window,width=40)
31+
text2.insert(0,'Last Name')
32+
text2.grid(row=2,column=3,padx=(20,0))
33+
Label(window,text="Email: ", font="Helvetica 14").grid(row=3,column=1)
34+
35+
text3 = Entry(window,width=40)
36+
text3.insert(0,'user@example.com')
37+
text3.grid(row=3,column=2,)
38+
39+
Label(window,text="Education: ", font="Helvetica 14").grid(row=4,column=1)
40+
dropdown1 = tk.StringVar(value="Please Choose")
41+
education_chosen = ttk.Combobox(window,width=37,textvariable=dropdown1,state="readonly")
42+
43+
# Adding combobox drop down list
44+
education_chosen['values'] = (' Primary School',
45+
' Secondary School',
46+
' Higher-Secondary School',
47+
" Undergraduate/Bachelor's",
48+
" Postgraduate/Master's",
49+
' Doctoral/Ph.D')
50+
51+
education_chosen.grid(row=4,column=2)
52+
education_chosen.current()
53+
Label(window,text="Resume:",font="Helvetica 14").grid(row=5,column=1)
54+
def UploadAction(event=None):
55+
path = filedialog.askopenfilename(filetypes =[('PDF Files', '.pdf'),('DOC Files','.docx')])
56+
if path:
57+
filename = os.path.basename(path)
58+
Label(window,text="Selected File is: ", font="Helvetica 12",fg="red").grid(row=5,column=3)
59+
Label(window,text=filename, font="Helvetica 12",fg="black").place(x=850,y=215)
60+
else:
61+
Label(window,text="File Not Selected!", font="Helvetica 14",fg="red").grid(row=5,column=3)
62+
63+
button = tk.Button(window, text='Upload File',width=34,command=UploadAction).grid(row=5,column=2)
64+
Label(window,text="Address: ",font="Helvetica 14").grid(row=6,column=1)
65+
66+
text4 = Entry(window,width=40)
67+
text4.insert(0,'Address 1')
68+
text4.grid(row=6,column=2)
69+
70+
text5 = Entry(window,width=40)
71+
text5.insert(0,'Address 2')
72+
text5.grid(row=7,column=2)
73+
74+
dropdown2 = tk.StringVar(value="Select a Country")
75+
country_chosen = ttk.Combobox(window,width=20,textvariable=dropdown2,state="readonly")
76+
77+
# Adding combobox drop down list
78+
country_chosen['values'] = (' India',
79+
' UK',
80+
' USA',
81+
" CANADA",
82+
" Germany",
83+
' Austria')
84+
country_chosen.grid(row=8,column=2)
85+
country_chosen.current()
86+
87+
text6 = Entry(window,width=15)
88+
text6.insert(0,'CITY')
89+
text6.grid(row=9,column=2,padx=(1,0))
90+
91+
text7 = Entry(window,width=5)
92+
text7.insert(0,'STATE')
93+
text7.grid(row=9,column=3,padx=(1,0))
94+
95+
text8 = Entry(window,width=20)
96+
text8.insert(0,'ZIP CODE')
97+
text8.grid(row=9,column=4,padx=(1,0))
98+
99+
Label(window,text="Phone Number: ",font="Helvetica 14").grid(row=10,column=1)
100+
text9 = Entry(window,width=4).grid(row=10,column=2,padx=(0,150))
101+
text10 = Entry(window,width=20).grid(row=10,column=2)
102+
103+
Label(window,text="What are your hobbies?",font="Helvetica 14").grid(row=11,column=1)
104+
# text11 = Text(window,width=70,height=5).place(relx=0.1,rely=0.42)
105+
106+
Label(window,text="Precious/Current Employment Details", font="Helvetica 16 bold",fg="red").grid(row=9,column=1,pady=(100,20))
107+
108+
Label(window,text="Company Name: ",font="Helvetica 14").grid(row=10,column=1)
109+
text12 = Entry(window,width=40).grid(row=10,column=2)
110+
111+
Label(window,text="Job Title: ",font="Helvetica 14").grid(row=11,column=1)
112+
text13 = Entry(window,width=40).grid(row=11,column=2)
113+
114+
Label(window,text="How long were you here?: ",font="Helvetica 14").grid(row=12,column=1)
115+
text14 = Entry(window,width=40).grid(row=12,column=2)
116+
117+
118+
Label(window,text="Reference #1", font="Helvetica 16 bold",fg="red").grid(row=13,column=1,pady=(10,10))
119+
120+
Label(window,text="Name: ",font="Helvetica 14").grid(row=14,column=1)
121+
text15 = Entry(window,width=40).grid(row=14,column=2)
122+
123+
Label(window,text="Phone: ",font="Helvetica 14").grid(row=15,column=1)
124+
text16 = Entry(window,width=40).grid(row=15,column=2)
125+
126+
Label(window,text="Reference #2", font="Helvetica 16 bold",fg="red").grid(row=16,column=1,pady=(10,10))
127+
128+
Label(window,text="Name: ",font="Helvetica 14").grid(row=17,column=1)
129+
text17 = Entry(window,width=40).grid(row=17,column=2)
130+
131+
Label(window,text="Phone: ",font="Helvetica 14").grid(row=18,column=1)
132+
text18 = Entry(window,width=40).grid(row=18,column=2)
133+
134+
button_1 = Button(window, text="SUBMIT", padx=10, pady=5, command=lambda: Submit(), bg="black", fg="white").place(relx=0.5, rely=0.98, anchor=CENTER)
135+
136+
137+
window.mainloop()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /