Skip to content

Commit 943f0b8

Browse files
Update multiple scripts: added fixes and improvements
1 parent 44ab0a3 commit 943f0b8

File tree

23 files changed

+0
-90
lines changed

23 files changed

+0
-90
lines changed

alarm_clock/AlarmClock.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77

88
def snooze(t):
9-
global set_time
109
HH_MM = set_time.split(':')
1110
HH_MM[1] = str(int(HH_MM[1]) + t)
1211
set_time = ':'.join(HH_MM)

audio_sticky_notes/main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ def makenew():
77

88

99
def maker(wins):
10-
global numofwindows
1110
subprocess.Popen(["python.exe", "note.py", str(numofwindows)], shell=True)
1211
numofwindows = 1 + wins
1312
maintain()
1413

1514

1615
def maintain():
17-
global numofwindows
1816
storage = open("assets\\storage", "w")
1917
storage.write(str(numofwindows))
2018
storage.close()

auto_clicker/autoclicker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def choose_delay():
2727

2828

2929
def key_press(key):
30-
global running, pause
3130

3231
if key == start_or_pause_key:
3332
pause = not pause

auto_sms/main.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import requests
44

55
# Variables
6-
global apiKey
7-
global SID
8-
global senderID
96
apiKey = "" # enter your api key
107
SID = "" # enter your SID number
118
senderID = "" # enter the senderID registered

book_manager/bookman.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
class Ui_MainWindow(object):
2222
def setupUi(self, MainWindow):
23-
global books
2423
MainWindow.setObjectName("MainWindow")
2524
MainWindow.resize(1037, 622)
2625
self.centralwidget = QtWidgets.QWidget(MainWindow)
@@ -133,7 +132,6 @@ def retranslateUi(self, MainWindow):
133132

134133
def show_all(self):
135134
self.list_1.clear()
136-
global books
137135
# print(books)
138136
for item in books:
139137
newitem = QtWidgets.QListWidgetItem(
@@ -147,7 +145,6 @@ def show_all(self):
147145
self.lineEdit.clear()
148146

149147
def search_books(self):
150-
global books
151148
results = []
152149
searchtext = self.lineEdit.text()
153150
field = [self.radioButton_1.isChecked(), self.radioButton_2.isChecked(
@@ -167,7 +164,6 @@ def search_books(self):
167164
self.list_1.addItem(newitem)
168165

169166
def add_books(self):
170-
global books
171167
res = self.open_dialog_box()
172168
name = res[0].split('/')[-1]
173169
Dialog2 = QtWidgets.QDialog()
@@ -196,7 +192,6 @@ def open_dialog_box(self):
196192
# print(filename)
197193

198194
def open_properties(self, item):
199-
global books
200195
lines = item.text().split('\n')
201196
final = []
202197
for index, i in enumerate(lines):

corona_tracker_visualizer/corona_tracker.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,6 @@ def refresh():
339339
def main_ui():
340340
"""Main user interface"""
341341

342-
global root
343-
global frame_stat
344-
global frame_data
345342

346343
root = tk.Tk()
347344

discord_github_bot/bot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def get_github_notifications():
2626
# Notification Sender function
2727
async def send_notification(context):
2828
# Check if channel is present in guild
29-
global already_sent
3029
channel = discord_get(
3130
context.guild.text_channels,
3231
name=config.DISCORD_CHANNEL,

interview_automater/app.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717
# Defining global variables
18-
global name, score
1918
score = 0
2019

2120

@@ -81,7 +80,6 @@ def update_name(name, n_clicks):
8180
[Input('a1', 'value')]
8281
)
8382
def q1(a1):
84-
global score
8583
if a1 is None:
8684
raise PreventUpdate
8785
else:
@@ -107,7 +105,6 @@ def q1(a1):
107105
[Input('a2', 'value')]
108106
)
109107
def q2(a2):
110-
global score
111108
if a2 is None:
112109
raise PreventUpdate
113110
else:
@@ -135,7 +132,6 @@ def q2(a2):
135132
[Input('a3', 'value')]
136133
)
137134
def q3(a3):
138-
global score
139135
if a3 is None:
140136
raise PreventUpdate
141137
else:
@@ -177,7 +173,6 @@ def q3(a3):
177173
[Input('a4', 'value')]
178174
)
179175
def q4(a4):
180-
global score
181176
if a4 is None:
182177
raise PreventUpdate
183178
else:
@@ -210,7 +205,6 @@ def q4(a4):
210205
[Input('a5', 'value')]
211206
)
212207
def q5(a5):
213-
global score
214208
if a5 is None:
215209
raise PreventUpdate
216210
else:
@@ -235,7 +229,6 @@ def q5(a5):
235229
[Input('a6', 'value')]
236230
)
237231
def q6(a6):
238-
global score
239232
if a6 is None:
240233
raise PreventUpdate
241234
else:
@@ -263,7 +256,6 @@ def q6(a6):
263256
[Input('a7', 'value')]
264257
)
265258
def q7(a7):
266-
global score
267259
if a7 is None:
268260
raise PreventUpdate
269261
else:
@@ -291,7 +283,6 @@ def q7(a7):
291283
[Input('a8', 'value')]
292284
)
293285
def q8(a8):
294-
global score
295286
if a8 is None:
296287
raise PreventUpdate
297288
else:
@@ -321,7 +312,6 @@ def q8(a8):
321312
[Input('a9', 'value')]
322313
)
323314
def q9(a9):
324-
global score
325315
if a9 is None:
326316
raise PreventUpdate
327317
else:
@@ -357,7 +347,6 @@ def q9(a9):
357347
[Input('a10', 'value')]
358348
)
359349
def q10(a10):
360-
global score
361350
if a10 is None:
362351
raise PreventUpdate
363352
else:

jpg_to_png/jpg_to_png.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
# function to convert file from jpg to png
2424

2525
def jpg_to_png():
26-
global im1
2726
import_filename = fd.askopenfilename()
2827

2928
if import_filename.endswith('.jpg'):
@@ -42,7 +41,6 @@ def jpg_to_png():
4241
# function to convert png file to jpg
4342

4443
def png_to_jpg():
45-
global im1
4644
import_filename = fd.askopenfilename()
4745

4846
if import_filename.endswith('.png'):

json_to_md/script.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,11 @@ def build_value_chain(key, value, depth):
6868

6969
def add_header(value, depth):
7070
chain = build_header_chain(depth)
71-
global markdown
7271
markdown += chain.replace('value', value.title())
7372

7473

7574
def add_value(key, value, depth):
7675
chain = build_value_chain(key, value, depth)
77-
global markdown
7876
markdown += chain
7977

8078

@@ -87,7 +85,6 @@ def convert(input_file, output_file, options):
8785
json_data = load_json(input_file)
8886
depth = 0
8987
parse_json(json_data, depth, options)
90-
global markdown
9188
markdown = markdown.replace('#######', '######')
9289
write_out(markdown, output_file)
9390

0 commit comments

Comments
 (0)