Skip to content

Commit 0bb431c

Browse files
committed
code fixes and improve the directory structure
1 parent 94b1c63 commit 0bb431c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+455
-213
lines changed
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# Requirements : pip install pygame
22
# Save an audio with the name alarm_clock.mp3
33

4+
import datetime
5+
import time
6+
47
from pygame import mixer
5-
import datetime,time
68

7-
def musiconloop(file,stopper):
9+
10+
def musiconloop(file, stopper):
811
mixer.init()
912
mixer.music.load(file)
1013
mixer.music.play()
@@ -14,14 +17,15 @@ def musiconloop(file,stopper):
1417
mixer.music.stop()
1518
break
1619

20+
1721
if __name__ == '__main__':
1822
t = input("Enter the time in minutes to set Alarm : ")
19-
secs=int(t)*60
23+
secs = int(t) * 60
2024
t = datetime.time(0, int(t))
2125
init_t = time.time()
2226

2327
while True:
2428
if time.time() - init_t > secs:
2529
print("Enter 'pause' to stop the alarm.")
26-
musiconloop('alarm_clock.mp3',"pause")
27-
exit()
30+
musiconloop('alarm_clock.mp3', "pause")
31+
exit()

FlaskAPI/binary_search_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def insert(self, data):
4949
self._insert_recursive(data, self.root)
5050

5151
def _search_recursive(self, blog_post_id, node):
52-
if node.left == None and node.right == None:
52+
if node.left is None and node.right is None:
5353
return False
5454
if blog_post_id == node.data["id"]:
5555
return node.data

FlaskAPI/generate_dummy_data.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
from random import randrange
44
from sqlite3 import Connection as SQLite3Connection
55

6+
import server
67
from faker import Faker
78
from flask import Flask
89
from flask_sqlalchemy import SQLAlchemy
910
from sqlalchemy import event
1011
from sqlalchemy.engine import Engine
1112

12-
import server
13-
1413
# app
1514
app = Flask(__name__)
1615

FlaskAPI/server.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
from datetime import datetime
33
from sqlite3 import Connection as SQLite3Connection
44

5-
from flask import Flask, jsonify, request
6-
from flask_sqlalchemy import SQLAlchemy
7-
from sqlalchemy import event
8-
from sqlalchemy.engine import Engine
9-
105
import binary_search_tree
116
import hash_table
127
import linked_list
138
import stack
149
from custom_q import Queue
10+
from flask import Flask, jsonify, request
11+
from flask_sqlalchemy import SQLAlchemy
12+
from sqlalchemy import event
13+
from sqlalchemy.engine import Engine
1514

1615
# app
1716
app = Flask(__name__)
Lines changed: 140 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,186 @@
1-
from tkinter import *
2-
from tkinter.ttk import *
31
import sqlite3
4-
import tkinter as tk
2+
import tkinter as tk
3+
from tkinter import *
54
from tkinter import messagebox
5+
from tkinter.ttk import *
66

77
window = Tk()
88
window.title("JOB PORTAL")
99
window.geometry("1100x900")
1010

1111

12-
name=StringVar()
13-
lname=StringVar()
14-
email=StringVar()
15-
combo=StringVar()
16-
ad1=StringVar()
17-
ad2=StringVar()
18-
ad3=StringVar()
19-
cmb=StringVar()
20-
phone=IntVar()
21-
ph=IntVar()
22-
hobbies=StringVar()
23-
cn=StringVar()
24-
jt=StringVar()
25-
time=IntVar()
26-
refnm=StringVar()
27-
mob=IntVar()
12+
name = StringVar()
13+
lname = StringVar()
14+
email = StringVar()
15+
combo = StringVar()
16+
ad1 = StringVar()
17+
ad2 = StringVar()
18+
ad3 = StringVar()
19+
cmb = StringVar()
20+
phone = IntVar()
21+
ph = IntVar()
22+
hobbies = StringVar()
23+
cn = StringVar()
24+
jt = StringVar()
25+
time = IntVar()
26+
refnm = StringVar()
27+
mob = IntVar()
28+
2829

2930
def data():
30-
nm=name.get()
31-
lnm=lname.get()
32-
eml=email.get()
33-
com=cmb.get()
34-
add1=ad1.get()
35-
add2=ad2.get()
36-
add3=ad3.get()
37-
comb=cmb.get()
38-
phn=phone.get()
39-
phn1=ph.get()
40-
hob=hobbies.get()
41-
company=cn.get()
42-
job=jt.get()
43-
tim=time.get()
44-
nam=refnm.get()
45-
mobile=mob.get()
46-
47-
31+
nm = name.get()
32+
lnm = lname.get()
33+
eml = email.get()
34+
com = cmb.get()
35+
add1 = ad1.get()
36+
add2 = ad2.get()
37+
add3 = ad3.get()
38+
comb = cmb.get()
39+
phn = phone.get()
40+
phn1 = ph.get()
41+
hob = hobbies.get()
42+
company = cn.get()
43+
job = jt.get()
44+
tim = time.get()
45+
nam = refnm.get()
46+
mobile = mob.get()
47+
4848
db = sqlite3.connect('job.db')
49-
cursor=db.cursor()
49+
cursor = db.cursor()
5050
cursor.execute('CREATE TABLE IF NOT EXISTS JOB(name TEXT,lname TEXT,email TEXT,combo TEXT,ad1 TEXT,ad2 TEXT,ad3 TEXT,cmb TEXT,phone INT,ph INT,hobbies TEXT,cn TEXT,jt TEXT,time INT,refnm TEXT,mob INT)')
51-
cursor.execute('INSERT INTO JOB(name,lname,email,combo,ad1,ad2,ad3,cmb,phone,ph,hobbies,cn,jt,time,refnm,mob) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
52-
(nm,lnm,eml,com,add1,add2,add3,comb,phn,phn1,hob,company,job,tim,nam,mobile))
53-
51+
cursor.execute(
52+
'INSERT INTO JOB(name,lname,email,combo,ad1,ad2,ad3,cmb,phone,ph,hobbies,cn,jt,time,refnm,mob) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
53+
(nm,
54+
lnm,
55+
eml,
56+
com,
57+
add1,
58+
add2,
59+
add3,
60+
comb,
61+
phn,
62+
phn1,
63+
hob,
64+
company,
65+
job,
66+
tim,
67+
nam,
68+
mobile))
69+
5470
db.commit()
55-
msg = messagebox.showinfo( "DB Demo","SUBMITTED SUCCESSFULLY")
56-
71+
msg = messagebox.showinfo("DB Demo", "SUBMITTED SUCCESSFULLY")
72+
73+
5774
def display():
5875
db = sqlite3.connect('job.db')
5976
with db:
60-
cursor=db.cursor()
77+
cursor = db.cursor()
6178
my_w = Tk()
62-
my_w.geometry("400x250")
79+
my_w.geometry("400x250")
6380

64-
r_set=cursor.execute('''SELECT * from JOB ''');
65-
i=0
81+
r_set = cursor.execute('''SELECT * from JOB ''')
82+
i = 0
6683
for JOB in r_set:
6784
for j in range(len(JOB)):
68-
e = Entry(my_w, width=10, fg='blue')
69-
e.grid(row=i, column=j)
85+
e = Entry(my_w, width=10, fg='blue')
86+
e.grid(row=i, column=j)
7087
e.insert(END, JOB[j])
71-
i=i+1
88+
i = i + 1
7289

73-
ja = Label(window,text="JOB APPLICATION", foreground="black",font=("Arial Bold",35)).place(x=500,y=0)
74-
pa = Label(window,text="PERSONAL INFORMATION",foreground="red",font=("Arial Bold",18)).place(x=200,y=70)
7590

76-
name = Label(window,text="NAME:-",font=("Arial",14)).place(x=200,y=120)
77-
name = Entry(window,width=40)
78-
name.place(x=440,y=125)
79-
lname =Entry(window,width=40)
80-
lname.place(x=700,y=125)
91+
ja = Label(window, text="JOB APPLICATION", foreground="black",
92+
font=("Arial Bold", 35)).place(x=500, y=0)
93+
pa = Label(window, text="PERSONAL INFORMATION", foreground="red",
94+
font=("Arial Bold", 18)).place(x=200, y=70)
8195

82-
email= Label(window,text="EMAIL:-",font=("Arial",14)).place(x=200,y=160)
83-
email= Entry(window,width=60)
84-
email.place(x=440,y=160)
96+
name = Label(window, text="NAME:-", font=("Arial", 14)).place(x=200, y=120)
97+
name = Entry(window, width=40)
98+
name.place(x=440, y=125)
99+
lname = Entry(window, width=40)
100+
lname.place(x=700, y=125)
85101

86-
edu = Label(window,text="EDUCATION:-",font=("Arial",14)).place(x=200,y=200)
102+
email = Label(window, text="EMAIL:-", font=("Arial", 14)).place(x=200, y=160)
103+
email = Entry(window, width=60)
104+
email.place(x=440, y=160)
87105

88-
combo = Combobox(window,text="Please Choose",width=30)
89-
combo['values']=("High School","Senior Secondary Class","Under Graduate","Post Graduate")
90-
combo.place(x=440,y=200)
106+
edu = Label(window, text="EDUCATION:-", font=("Arial", 14)).place(x=200, y=200)
91107

92-
resume = Label(window,text="RESUME:-",font=("Arial",14)).place(x=200,y=240)
93-
btn = Button(window,text="Choose File").place(x=440,y=240)
94-
chfile = Label(window,text="No choosen File",font=("Arial",12)).place(x=520,y=240)
108+
combo = Combobox(window, text="Please Choose", width=30)
109+
combo['values'] = ("High School", "Senior Secondary Class",
110+
"Under Graduate", "Post Graduate")
111+
combo.place(x=440, y=200)
95112

96-
add = Label(window,text="ADDRESS:-",font=("Arial",14)).place(x=200,y=280)
113+
resume = Label(window, text="RESUME:-", font=("Arial", 14)).place(x=200, y=240)
114+
btn = Button(window, text="Choose File").place(x=440, y=240)
115+
chfile = Label(window, text="No choosen File",
116+
font=("Arial", 12)).place(x=520, y=240)
97117

98-
ad1 = Entry(window,width=60)
99-
ad1.place(x=440,y=280)
100-
add1= Label(window,text="Address 1").place(x=590,y=303)
118+
add = Label(window, text="ADDRESS:-", font=("Arial", 14)).place(x=200, y=280)
101119

102-
ad2 = Entry(window,width=60)
103-
ad2.place(x=440,y=330)
104-
add2= Label(window,text="Address 2").place(x=590,y=353)
120+
ad1 = Entry(window, width=60)
121+
ad1.place(x=440, y=280)
122+
add1 = Label(window, text="Address 1").place(x=590, y=303)
105123

106-
ad3 = Entry(window,width=60)
107-
ad3.place(x=440,y=380)
108-
add3= Label(window,text="Address 3").place(x=590,y=403)
124+
ad2 = Entry(window, width=60)
125+
ad2.place(x=440, y=330)
126+
add2 = Label(window, text="Address 2").place(x=590, y=353)
109127

110-
cotr = Label(window,text="COUNTRY:-",font=("Arial",14)).place(x=200,y=430)
128+
ad3 = Entry(window, width=60)
129+
ad3.place(x=440, y=380)
130+
add3 = Label(window, text="Address 3").place(x=590, y=403)
111131

112-
cmb = Combobox(window,text="Choose Country",width=30)
113-
cmb['values'] = ("India","Nepal","Sri Lanka","Afganistan","United Kingdom","United States of America","Please Text")
114-
cmb.place(x=440,y=430)
132+
cotr = Label(window, text="COUNTRY:-", font=("Arial", 14)).place(x=200, y=430)
115133

116-
phone = Label(window,text="PHONE NUMBER:-",font=("Arial",14)).place(x=200,y=460)
117-
phone = Entry(window,width=4)
118-
phone.place(x=440,y=460)
119-
ph = Entry(window,width=24)
120-
ph.place(x=490,y=460)
134+
cmb = Combobox(window, text="Choose Country", width=30)
135+
cmb['values'] = ("India", "Nepal", "Sri Lanka", "Afganistan",
136+
"United Kingdom", "United States of America", "Please Text")
137+
cmb.place(x=440, y=430)
121138

122-
hob = Label(window,text="What are your Hobbies:-",font=("Arial",14)).place(x=200,y=500)
123-
hobbies = Entry(window,width=120)
124-
hobbies.place(x=200,y=530)
139+
phone = Label(window, text="PHONE NUMBER:-",
140+
font=("Arial", 14)).place(x=200, y=460)
141+
phone = Entry(window, width=4)
142+
phone.place(x=440, y=460)
143+
ph = Entry(window, width=24)
144+
ph.place(x=490, y=460)
125145

126-
ce = Label(window,text="PREVIOUS/CURRENT EMPLOYMENT DETAILS",foreground="red",font=("Arial Bold",18)).place(x=200,y=560)
146+
hob = Label(window, text="What are your Hobbies:-",
147+
font=("Arial", 14)).place(x=200, y=500)
148+
hobbies = Entry(window, width=120)
149+
hobbies.place(x=200, y=530)
127150

128-
cn = Label(window,text="COMPANY NAME:-",font=("Arial",14)).place(x=200,y=600)
129-
cn = Entry(window,width=30)
130-
cn.place(x=440,y=605)
151+
ce = Label(window, text="PREVIOUS/CURRENT EMPLOYMENT DETAILS",
152+
foreground="red", font=("Arial Bold", 18)).place(x=200, y=560)
131153

132-
jt = Label(window,text="JOB TITLE:-",font=("Arial",14)).place(x=200,y=640)
133-
jt = Entry(window,width=30)
134-
jt.place(x=440,y=640)
154+
cn = Label(window, text="COMPANY NAME:-",
155+
font=("Arial", 14)).place(x=200, y=600)
156+
cn = Entry(window, width=30)
157+
cn.place(x=440, y=605)
135158

136-
time = Label(window,text="HOW LONG WERE YOU HERE?:-",font=("Arial",14)).place(x=200,y=680)
159+
jt = Label(window, text="JOB TITLE:-", font=("Arial", 14)).place(x=200, y=640)
160+
jt = Entry(window, width=30)
161+
jt.place(x=440, y=640)
162+
163+
time = Label(window, text="HOW LONG WERE YOU HERE?:-",
164+
font=("Arial", 14)).place(x=200, y=680)
137165
time = Entry(window)
138-
time.place(x=500,y=680)
166+
time.place(x=500, y=680)
167+
168+
ref = Label(window, text="REFERENCE", font=(
169+
"Arial Bold", 16)).place(x=720, y=605)
170+
refnm = Label(window, text="NAME:-", font=("Arial", 12)).place(x=720, y=640)
171+
refnm = Entry(window, width=40)
172+
refnm.place(x=800, y=640)
139173

140-
ref = Label(window,text="REFERENCE",font=("Arial Bold", 16)).place(x=720,y=605)
141-
refnm = Label(window,text="NAME:-",font=("Arial",12)).place(x=720,y=640)
142-
refnm = Entry(window,width=40)
143-
refnm.place(x=800,y=640)
174+
mob = Label(window, text="MOB NO.:-", font=("Arial", 12)).place(x=720, y=680)
175+
mob = Entry(window, width=40)
176+
mob.place(x=800, y=680)
144177

145-
mob = Label(window,text="MOB NO.:-",font=("Arial",12)).place(x=720,y=680)
146-
mob = Entry(window,width=40)
147-
mob.place(x=800,y=680)
148178

179+
msg = Button(window, text='APPLY NOW', command=data,
180+
width=20).place(x=400, y=730)
149181

150-
msg=Button(window,text='APPLY NOW',command=data,width=20).place(x=400,y=730)
182+
msg = Button(window, text="DISPLAY RECORD(s)",
183+
command=display, width=20).place(x=600, y=730)
151184

152-
msg=Button(window,text="DISPLAY RECORD(s)",command=display,width=20).place(x=600,y=730)
153185

154-
155-
window.mainloop()
186+
window.mainloop()

0 commit comments

Comments
 (0)