Skip to content

Commit 18dc7b3

Browse files
authored
initial commit
1 parent 39c65a0 commit 18dc7b3

11 files changed

+640
-0
lines changed

Diff for: Barcode.py

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import cv2
2+
from pyzbar import pyzbar
3+
4+
5+
def read_barcodes(frame):
6+
barcodes = pyzbar.decode(frame)
7+
for barcode in barcodes:
8+
x, y, w, h = barcode.rect
9+
barcode_info = barcode.data.decode('utf-8')
10+
cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)
11+
12+
font = cv2.FONT_HERSHEY_DUPLEX
13+
cv2.putText(frame, barcode_info, (x + 6, y - 6), font, 2.0, (255, 255, 255), 1)
14+
with open("barcode_result.txt", mode='w') as file:
15+
file.write("Recognized Barcode:" + barcode_info)
16+
return frame
17+
18+
19+
def main():
20+
camera = cv2.VideoCapture(0)
21+
ret, frame = camera.read()
22+
while ret:
23+
ret, frame = camera.read()
24+
frame = read_barcode(frame)
25+
cv2.imshow('Barcode/QR code reader', frame)
26+
if cv2.waitKey(1) & 0xFF == 27:
27+
break
28+
camera.release()
29+
cv2.destroyAllWindows()
30+
31+
32+
if __name__ == '__main__':
33+
main()

Diff for: MusicPlayer.py

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import pygame
2+
import tkinter as tkr
3+
from tkinter.filedialog import askdirectory
4+
import os
5+
6+
music_player = tkr.Tk()
7+
music_player.title("My Music Player")
8+
music_player.geometry("450x350")
9+
directory = askdirectory()
10+
os.chdir(directory)
11+
song_list = os.listdir()
12+
13+
play_list = tkr.Listbox(music_player, font="Helvetica 12 bold", bg='yellow', selectmode=tkr.SINGLE)
14+
for item in song_list:
15+
pos = 0
16+
play_list.insert(pos, item)
17+
pos += 1
18+
pygame.init()
19+
pygame.mixer.init()
20+
21+
def play():
22+
pygame.mixer.music.load(play_list.get(tkr.ACTIVE))
23+
var.set(play_list.get(tkr.ACTIVE))
24+
pygame.mixer.music.play()
25+
def stop():
26+
pygame.mixer.music.stop()
27+
def pause():
28+
pygame.mixer.music.pause()
29+
def unpause():
30+
pygame.mixer.music.unpause()
31+
Button1 = tkr.Button(music_player, width=5, height=3, font="Helvetica 12 bold", text="PLAY", command=play, bg="blue", fg="white")
32+
Button2 = tkr.Button(music_player, width=5, height=3, font="Helvetica 12 bold", text="STOP", command=stop, bg="red", fg="white")
33+
Button3 = tkr.Button(music_player, width=5, height=3, font="Helvetica 12 bold", text="PAUSE", command=pause, bg="purple", fg="white")
34+
Button4 = tkr.Button(music_player, width=5, height=3, font="Helvetica 12 bold", text="UNPAUSE", command=unpause, bg="orange", fg="white")
35+
36+
var = tkr.StringVar()
37+
song_title = tkr.Label(music_player, font="Helvetica 12 bold", textvariable=var)
38+
39+
song_title.pack()
40+
Button1.pack(fill="x")
41+
Button2.pack(fill="x")
42+
Button3.pack(fill="x")
43+
Button4.pack(fill="x")
44+
play_list.pack(fill="both", expand="yes")
45+
music_player.mainloop()

Diff for: Notification.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import time
2+
from plyer import notification
3+
4+
if __name__ == "__main__":
5+
while True:
6+
notification.notify(
7+
title = "ALERT!!!",
8+
message = "Take a break! It has been an hour!",
9+
timeout = 1
10+
)
11+
time.sleep(1)

Diff for: ResumeScanner.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def scan_resume(resume):
2+
from resume_parser import resumeparse
3+
data = resumeparse.read_file(resume)
4+
for i, j in data.items():
5+
print(f"{i}:>>{j}")
6+
7+
8+
scan_resume("Resume.docx")

Diff for: TurtleGrap.py

+279
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
import turtle as tu
2+
3+
roo = tu.Turtle()
4+
wn = tu.Screen()
5+
wn.bgcolor("black")
6+
wn.title("Fractal Tree Pattern")
7+
roo.left(90)
8+
roo.speed(20)
9+
10+
11+
def draw(l):
12+
if (l < 10):
13+
return
14+
else:
15+
16+
roo.pensize(2)
17+
roo.pencolor("yellow")
18+
roo.forward(l)
19+
roo.left(30)
20+
draw(3 * l / 4)
21+
roo.right(60)
22+
draw(3 * l / 4)
23+
roo.left(30)
24+
roo.pensize(2)
25+
roo.backward(l)
26+
27+
28+
draw(20)
29+
30+
roo.right(90)
31+
roo.speed(2000)
32+
33+
34+
# recursion
35+
def draw(l):
36+
if (l < 10):
37+
return
38+
else:
39+
roo.pensize(2)
40+
roo.pencolor("magenta")
41+
roo.forward(l)
42+
roo.left(30)
43+
draw(3 * l / 4)
44+
roo.right(60)
45+
draw(3 * l / 4)
46+
roo.left(30)
47+
roo.pensize(2)
48+
roo.backward(l)
49+
50+
51+
draw(20)
52+
53+
roo.left(270)
54+
roo.speed(2000)
55+
56+
57+
# recursion
58+
def draw(l):
59+
if (l < 10):
60+
return
61+
else:
62+
roo.pensize(2)
63+
roo.pencolor("red")
64+
roo.forward(l)
65+
roo.left(30)
66+
draw(3 * l / 4)
67+
roo.right(60)
68+
draw(3 * l / 4)
69+
roo.left(30)
70+
roo.pensize(2)
71+
roo.backward(l)
72+
73+
74+
draw(20)
75+
76+
roo.right(90)
77+
roo.speed(2000)
78+
79+
80+
# recursion
81+
def draw(l):
82+
if (l < 10):
83+
return
84+
else:
85+
roo.pensize(2)
86+
roo.pencolor('#FFF8DC')
87+
roo.forward(l)
88+
roo.left(30)
89+
draw(3 * l / 4)
90+
roo.right(60)
91+
draw(3 * l / 4)
92+
roo.left(30)
93+
roo.pensize(2)
94+
roo.backward(l)
95+
96+
97+
draw(20)
98+
99+
100+
########################################################
101+
102+
def draw(l):
103+
if (l < 10):
104+
return
105+
else:
106+
107+
roo.pensize(3)
108+
roo.pencolor("lightgreen")
109+
roo.forward(l)
110+
roo.left(30)
111+
draw(4 * l / 5)
112+
roo.right(60)
113+
draw(4 * l / 5)
114+
roo.left(30)
115+
roo.pensize(3)
116+
roo.backward(l)
117+
118+
119+
draw(40)
120+
121+
roo.right(90)
122+
roo.speed(2000)
123+
124+
125+
# recursion
126+
def draw(l):
127+
if (l < 10):
128+
return
129+
else:
130+
roo.pensize(3)
131+
roo.pencolor("red")
132+
roo.forward(l)
133+
roo.left(30)
134+
draw(4 * l / 5)
135+
roo.right(60)
136+
draw(4 * l / 5)
137+
roo.left(30)
138+
roo.pensize(3)
139+
roo.backward(l)
140+
141+
142+
draw(40)
143+
144+
roo.left(270)
145+
roo.speed(2000)
146+
147+
148+
# recursion
149+
def draw(l):
150+
if (l < 10):
151+
return
152+
else:
153+
roo.pensize(3)
154+
roo.pencolor("yellow")
155+
roo.forward(l)
156+
roo.left(30)
157+
draw(4 * l / 5)
158+
roo.right(60)
159+
draw(4 * l / 5)
160+
roo.left(30)
161+
roo.pensize(3)
162+
roo.backward(l)
163+
164+
165+
draw(40)
166+
167+
roo.right(90)
168+
roo.speed(2000)
169+
170+
171+
# recursion
172+
def draw(l):
173+
if (l < 10):
174+
return
175+
else:
176+
roo.pensize(3)
177+
roo.pencolor('#FFF8DC')
178+
roo.forward(l)
179+
roo.left(30)
180+
draw(4 * l / 5)
181+
roo.right(60)
182+
draw(4 * l / 5)
183+
roo.left(30)
184+
roo.pensize(3)
185+
roo.backward(l)
186+
187+
188+
draw(40)
189+
190+
191+
########################################################
192+
def draw(l):
193+
if (l < 10):
194+
return
195+
else:
196+
197+
roo.pensize(2)
198+
roo.pencolor("cyan")
199+
roo.forward(l)
200+
roo.left(30)
201+
draw(6 * l / 7)
202+
roo.right(60)
203+
draw(6 * l / 7)
204+
roo.left(30)
205+
roo.pensize(2)
206+
roo.backward(l)
207+
208+
209+
draw(60)
210+
211+
roo.right(90)
212+
roo.speed(2000)
213+
214+
215+
# recursion
216+
def draw(l):
217+
if (l < 10):
218+
return
219+
else:
220+
roo.pensize(2)
221+
roo.pencolor("yellow")
222+
roo.forward(l)
223+
roo.left(30)
224+
draw(6 * l / 7)
225+
roo.right(60)
226+
draw(6 * l / 7)
227+
roo.left(30)
228+
roo.pensize(2)
229+
roo.backward(l)
230+
231+
232+
draw(60)
233+
234+
roo.left(270)
235+
roo.speed(2000)
236+
237+
238+
# recursion
239+
def draw(l):
240+
if (l < 10):
241+
return
242+
else:
243+
roo.pensize(2)
244+
roo.pencolor("magenta")
245+
roo.forward(l)
246+
roo.left(30)
247+
draw(6 * l / 7)
248+
roo.right(60)
249+
draw(6 * l / 7)
250+
roo.left(30)
251+
roo.pensize(2)
252+
roo.backward(l)
253+
254+
255+
draw(60)
256+
257+
roo.right(90)
258+
roo.speed(2000)
259+
260+
261+
# recursion
262+
def draw(l):
263+
if (l < 10):
264+
return
265+
else:
266+
roo.pensize(2)
267+
roo.pencolor('#FFF8DC')
268+
roo.forward(l)
269+
roo.left(30)
270+
draw(6 * l / 7)
271+
roo.right(60)
272+
draw(6 * l / 7)
273+
roo.left(30)
274+
roo.pensize(2)
275+
roo.backward(l)
276+
277+
278+
draw(60)
279+
wn.exitonclick()

Diff for: label.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import tkinter
2+
from tkinter import *
3+
win = Tk()
4+
l=Label(win, text='username')
5+
l.pack()
6+
l2=Label(win,text = 'Password')
7+
l2.pack()
8+
e=Entry(win)
9+
e.pack()
10+
11+
12+
13+
win.mainloop()

0 commit comments

Comments
 (0)