Skip to content

Commit 3ae6330

Browse files
committed
update
1 parent fcb8da0 commit 3ae6330

File tree

7 files changed

+152
-157
lines changed

7 files changed

+152
-157
lines changed

Autocomplete Notes App/wordlist.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5465,9 +5465,9 @@
54655465
massachusetts
54665466
massage
54675467
massive
5468-
master
5469-
mastercard
5470-
masters
5468+
main
5469+
maincard
5470+
mains
54715471
masturbating
54725472
masturbation
54735473
mat
@@ -9718,8 +9718,8 @@
97189718
webcast
97199719
weblog
97209720
weblogs
9721-
webmaster
9722-
webmasters
9721+
webmain
9722+
webmains
97239723
webpage
97249724
webshots
97259725
website

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ If this is your first time contributing to an open source project, check out thi
2828

2929
## Code of Conduct
3030

31-
We strive to maintain a welcoming and inclusive community. Please read and respect our [Code of Conduct](https://github.com/DhanushNehru/Python-Scripts/blob/master/CODE_OF_CONDUCT.md) in all your interactions.
31+
We strive to maintain a welcoming and inclusive community. Please read and respect our [Code of Conduct](https://github.com/DhanushNehru/Python-Scripts/blob/main/CODE_OF_CONDUCT.md) in all your interactions.

Hand Volume/main.py

Lines changed: 69 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
wCam, hCam = 640, 480
2-
frameR = 100 # Frame Reduction
2+
frameR = 100 # Frame Reduction
33
smoothening = 7
44

55
pTime = 0
@@ -10,7 +10,7 @@
1010
import cv2
1111
import os
1212
from PIL import Image, ImageDraw
13-
import math
13+
import math
1414
import time
1515
import handTrackingModule as htm
1616
from ctypes import cast, POINTER
@@ -20,18 +20,17 @@
2020

2121
# Get default audio device using PyCAW
2222
devices = AudioUtilities.GetSpeakers()
23-
interface = devices.Activate(
24-
IAudioEndpointVolume._iid_, CLSCTX_ALL, None)
23+
interface = devices.Activate(IAudioEndpointVolume._iid_, CLSCTX_ALL, None)
2524
volume = cast(interface, POINTER(IAudioEndpointVolume))
26-
# Get current volume
27-
currentVolumeDb = volume.GetMasterVolumeLevel()
28-
29-
30-
wcam,hcam=640,480
31-
cap=cv2.VideoCapture(0)
32-
cap.set(3,wcam)
33-
cap.set(4,hcam)
34-
pTime=0
25+
# Get current volume
26+
currentVolumeDb = volume.GetmainVolumeLevel()
27+
28+
29+
wcam, hcam = 640, 480
30+
cap = cv2.VideoCapture(0)
31+
cap.set(3, wcam)
32+
cap.set(4, hcam)
33+
pTime = 0
3534
detector = htm.handDetector(detectionCon=0.75)
3635

3736
LastPx = 800
@@ -41,34 +40,33 @@
4140

4241
while True:
4342
# Background = Image.open('Background.jpg')
44-
success,img=cap.read()
45-
46-
img = detector.findHands(img, draw=True )
47-
lmList=detector.findPosition(img,draw=False)
48-
#print(lmList)
49-
tipId=[4,8,12,16,20]
50-
51-
#Rectangle
52-
53-
if(len(lmList)!=0):
54-
fingers=[]
55-
#thumb
56-
if(lmList[tipId[0]][1]>lmList[tipId[0]-1][1]):
43+
success, img = cap.read()
44+
45+
img = detector.findHands(img, draw=True)
46+
lmList = detector.findPosition(img, draw=False)
47+
# print(lmList)
48+
tipId = [4, 8, 12, 16, 20]
49+
50+
# Rectangle
51+
52+
if len(lmList) != 0:
53+
fingers = []
54+
# thumb
55+
if lmList[tipId[0]][1] > lmList[tipId[0] - 1][1]:
56+
fingers.append(1)
57+
else:
58+
fingers.append(0)
59+
# 4 fingers
60+
for id in range(1, len(tipId)):
61+
if lmList[tipId[id]][2] < lmList[tipId[id] - 2][2]:
5762
fingers.append(1)
58-
else :
59-
fingers.append(0)
60-
#4 fingers
61-
for id in range(1,len(tipId)):
62-
63-
if(lmList[tipId[id]][2]<lmList[tipId[id]-2][2]):
64-
fingers.append(1)
65-
66-
else :
63+
64+
else:
6765
fingers.append(0)
6866
if len(lmList) != 0:
69-
x1, y1 = lmList[8][1:] #2nd finger
67+
x1, y1 = lmList[8][1:] # 2nd finger
7068
# x0, y0 = lmList[12][1:] #Middle Finder
71-
x0, y0 = lmList[4][1:] #thumb
69+
x0, y0 = lmList[4][1:] # thumb
7270

7371
# print(f'1{fingers[0]}')
7472
# print(f'2{fingers[1]}')
@@ -78,74 +76,69 @@
7876

7977
# if fingers[1] == 1 and fingers[2] == 0: #for 2nd finger and al finger close
8078
if fingers[1] == 1 and fingers[0] == 1:
81-
#2nd Finger
79+
# 2nd Finger
8280
x3 = np.interp(x1, (frameR, wCam - frameR), (0, 1080))
8381
y3 = np.interp(y1, (frameR, hCam - frameR), (0, 720))
8482

8583
clocX = plocX + (x3 - plocX) / smoothening
8684
clocY = plocY + (y3 - plocY) / smoothening
87-
88-
cv2.circle(img, (x1, y1), 15, (0, 0,255), cv2.FILLED)
89-
plocX, plocY = clocX, clocY
9085

91-
#THUMB
86+
cv2.circle(img, (x1, y1), 15, (0, 0, 255), cv2.FILLED)
87+
plocX, plocY = clocX, clocY
88+
89+
# THUMB
9290
x3 = np.interp(x0, (frameR, wCam - frameR), (0, 1080))
9391
y3 = np.interp(y0, (frameR, hCam - frameR), (0, 720))
9492

9593
clocX = plocX + (x3 - plocX) / smoothening
9694
clocY = plocY + (y3 - plocY) / smoothening
97-
95+
9896
cv2.circle(img, (x0, y0), 15, (0, 0, 255), cv2.FILLED)
9997
plocX, plocY = clocX, clocY
10098

101-
cv2.line(img,(x1,y1),(x0,y0),(0,0,255),2)
102-
distance = math.sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0))
99+
cv2.line(img, (x1, y1), (x0, y0), (0, 0, 255), 2)
100+
distance = math.sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0))
103101
# print(distance)
104102

105-
106-
if distance<50:
103+
if distance < 50:
107104
distance = 50
108-
elif distance>250:
109-
distance=250
110-
Percent = round((distance-50.0)/2)
105+
elif distance > 250:
106+
distance = 250
107+
Percent = round((distance - 50.0) / 2)
111108
# print(Percent)
112-
113-
109+
114110
# Changevolume = round(0.6525*math.log(Percent/100)*100)
115-
Changevolume = round(math.log((Percent/10)+1)*50*0.54 )
111+
Changevolume = round(math.log((Percent / 10) + 1) * 50 * 0.54)
116112
print(Changevolume)
117-
volume.SetMasterVolumeLevel(-65.25+Changevolume, None)
118-
119-
113+
volume.SetmainVolumeLevel(-65.25 + Changevolume, None)
120114

121-
height = int(340 - (Percent*2.0))
115+
height = int(340 - (Percent * 2.0))
122116
print(height)
123-
cv2.rectangle(img,(570,height),(620,340),(0,255,0),-1)
124-
cv2.rectangle(img,(570,140),(620,340),(255,0,0),2)
117+
cv2.rectangle(img, (570, height), (620, 340), (0, 255, 0), -1)
118+
cv2.rectangle(img, (570, 140), (620, 340), (255, 0, 0), 2)
125119
img = cv2.flip(img, 1)
126-
127-
font = cv2.FONT_HERSHEY_SIMPLEX
128-
bottomLeftCornerOfText = (15,130)
129-
fontScale = 1
130-
fontColor = (0,0,0)
131-
lineType = 2
132-
133-
cv2.putText(img,f'{Percent}%', bottomLeftCornerOfText, font, fontScale,fontColor,lineType)
134-
135-
cTime=time.time()
136-
fps=1.0/float(cTime-pTime)
137-
pTime=cTime
138-
139-
cv2.imshow("image",img)
140-
141120

121+
font = cv2.FONT_HERSHEY_SIMPLEX
122+
bottomLeftCornerOfText = (15, 130)
123+
fontScale = 1
124+
fontColor = (0, 0, 0)
125+
lineType = 2
126+
127+
cv2.putText(
128+
img, f"{Percent}%", bottomLeftCornerOfText, font, fontScale, fontColor, lineType
129+
)
130+
131+
cTime = time.time()
132+
fps = 1.0 / float(cTime - pTime)
133+
pTime = cTime
134+
135+
cv2.imshow("image", img)
142136

143137
# Background = cv2.imread('Background.jpg')
144138
# Background = cv2.flip(Background, 1)
145139
# cv2.imshow('img',Background)
146140

147-
148-
if(cv2.waitKey(1) & 0xFF== ord('q')):
141+
if cv2.waitKey(1) & 0xFF == ord("q"):
149142
break
150143

151144

Playlist Exchange/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<ul>
2121
<li><a href="https://pypi.org/project/fuzzywuzzy/" target="_blank">fuzzywuzzy==0.18.0</a></li>
2222
<li><a href="https://pandas.pydata.org/" target="_blank">pandas==1.3.2</a></li>
23-
<li><a href="https://docs.python-requests.org/en/master/" target="_blank">requests==2.31.0</a></li>
23+
<li><a href="https://docs.python-requests.org/en/main/" target="_blank">requests==2.31.0</a></li>
2424
<li><a href="https://spotipy.readthedocs.io/en/2.23.0/" target="_blank">spotipy==2.23.0</a></li>
2525
<li><a href="https://ytmusicapi.readthedocs.io/en/stable/" target="_blank">ytmusicapi==1.3.2</a></li>
2626
</ul>

Pomodoro Timer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The Pomodoro Timer is a productivity tool designed to help you manage your time
1313
1. **Clone the Repository or Download the Script:**
1414
- clone the repository:
1515
```
16-
git clone https://github.com/max-lopzzz/Python-Scripts/tree/master/Pomodoro%20Timer
16+
git clone https://github.com/max-lopzzz/Python-Scripts/tree/main/Pomodoro%20Timer
1717
```
1818
- Or download the script directly from the repository page.
1919
2. **Navigate to the Script Location:** Open your terminal (Command Prompt on Windows, Terminal on macOS/Linux) and navigate to the folder containing the script:

0 commit comments

Comments
 (0)