Skip to content

Commit 34a6980

Browse files
committed
enforece PEP-8guidelines
1 parent 9eda5fa commit 34a6980

File tree

72 files changed

+1353
-1169
lines changed

Some content is hidden

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

72 files changed

+1353
-1169
lines changed

Python/AnimeTracker/Tracker.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from tkinter import *
44
from tkinter import messagebox
55

6+
67
def nextdate(name):
78
try:
89
res = requests.get("https://www.episodate.com/tv-show/" + name)
@@ -12,9 +13,11 @@ def nextdate(name):
1213
next_episode = next_episode.replace('"', "")
1314
next_episode = next_episode.replace("status", "")
1415
next_episode = next_episode.replace("/div><", "")
15-
next_episode = next_episode.replace("class=><a href=/sear","Show not Found")
16+
next_episode = next_episode.replace(
17+
"class=><a href=/sear", "Show not Found")
1618
if (next_episode == None):
17-
check = soup.find('div', {'class': 'countdown'}).find('div', {"class": "status"})
19+
check = soup.find('div', {'class': 'countdown'}).find(
20+
'div', {"class": "status"})
1821
check_status = check.getText()
1922
return check_status
2023
else:
@@ -24,19 +27,21 @@ def nextdate(name):
2427

2528

2629
def function():
27-
value=nextdate(e.get().lower())
30+
value = nextdate(e.get().lower())
2831
mylabel = Label(frame, text=e.get()+" "+value)
2932
mylabel.pack()
30-
messagebox.showinfo("Next airing date: "+e.get(),value)
33+
messagebox.showinfo("Next airing date: "+e.get(), value)
34+
3135

32-
value=""
33-
root=Tk()
36+
value = ""
37+
root = Tk()
3438
root.title("Next Episodate")
35-
frame=LabelFrame(root,text="Find your TV Show/anime next Episode Date:", padx=5,pady=5)
36-
frame.pack(padx=10,pady=10)
37-
e=Entry(frame,width=25)
39+
frame = LabelFrame(
40+
root, text="Find your TV Show/anime next Episode Date:", padx=5, pady=5)
41+
frame.pack(padx=10, pady=10)
42+
e = Entry(frame, width=25)
3843
e.pack()
39-
b=Button(frame,text="search",command=function)
44+
b = Button(frame, text="search", command=function)
4045
b.pack()
4146
root.mainloop()
4247

Python/Automate Login/Login.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212

1313
def login(email, password):
14-
driver = webdriver.Chromdriver= webdriver.Chrome('./Hacking-Scripts/Python/Automate Login/chromedriver')
14+
driver = webdriver.Chromdriver = webdriver.Chrome(
15+
'./Hacking-Scripts/Python/Automate Login/chromedriver')
1516
driver.get(login_url)
1617
time.sleep(1)
1718
# Entering Email Address

Python/BMI_GUI/app.py

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,62 +4,67 @@
44

55
# Funtion to calculate the BMI, given height and weight
66
# We have added height in cms and weight in Kgs (?)
7-
def getBMI(height : float, weight : float) -> float:
7+
import tkinter as tk
8+
9+
10+
def getBMI(height: float, weight: float) -> float:
811
# Returns calculated BMI
912
# height is in cms, convert to metres
1013
cm_to_m = 0.01
1114
height_in_metres = cm_to_m * height
1215
return round(weight / (height_in_metres * height_in_metres), 3)
1316

17+
1418
# main app setup
15-
import tkinter as tk
1619
root = tk.Tk(className=" Calculate BMI")
1720

1821
# Setup of main layout
1922
main_canvas = tk.Canvas(root, width=400, height=300)
2023
main_canvas.pack()
2124

2225
# App heading mentioning what type of app it is
23-
app_heading = tk.Label(root, text = 'Calculate BMI')
26+
app_heading = tk.Label(root, text='Calculate BMI')
2427
app_heading.config(font=('monospace', 20, 'bold'))
25-
main_canvas.create_window(200, 20, window = app_heading)
28+
main_canvas.create_window(200, 20, window=app_heading)
2629

2730
# widget to Get the value of height
2831
height_box = tk.Entry(root)
29-
main_canvas.create_window(100, 100, window = height_box)
32+
main_canvas.create_window(100, 100, window=height_box)
3033

3134
# Height Label
32-
height_label = tk.Label(root, text = 'Enter Height (cms)')
35+
height_label = tk.Label(root, text='Enter Height (cms)')
3336
app_heading.config(font=('arial', 15, 'bold'))
34-
main_canvas.create_window(100, 85, window = height_label)
37+
main_canvas.create_window(100, 85, window=height_label)
3538

3639
# widget to get the value of weight
3740
weight_box = tk.Entry(root)
38-
main_canvas.create_window(300, 100, window = weight_box)
41+
main_canvas.create_window(300, 100, window=weight_box)
3942

4043
# Weight Label
41-
weight_label = tk.Label(root, text = 'Enter Weight (kgs)')
44+
weight_label = tk.Label(root, text='Enter Weight (kgs)')
4245
app_heading.config(font=('arial', 15, 'bold'))
43-
main_canvas.create_window(300, 85, window = weight_label)
46+
main_canvas.create_window(300, 85, window=weight_label)
4447

4548
# Function to get and display BMI from widgets
49+
50+
4651
def show_bmi_from_entries() -> None:
47-
# Calcultes BMI,
52+
# Calcultes BMI,
4853
height = height_box.get()
4954
weight = weight_box.get()
50-
#
55+
#
5156
bmi = getBMI(height=float(height), weight=float(weight))
5257

53-
bmi_info_label = tk.Label(root, text = 'Your BMI is')
58+
bmi_info_label = tk.Label(root, text='Your BMI is')
5459
main_canvas.create_window(200, 210, window=bmi_info_label)
55-
56-
bmi_value = tk.Label(root, text= bmi,font=('helvetica', 10, 'bold'))
60+
61+
bmi_value = tk.Label(root, text=bmi, font=('helvetica', 10, 'bold'))
5762
main_canvas.create_window(200, 230, window=bmi_value)
5863

5964

6065
# Button to calculate the BMI of person
61-
get_bmi_button = tk.Button(text = 'Calculate BMI', command = show_bmi_from_entries)
66+
get_bmi_button = tk.Button(text='Calculate BMI', command=show_bmi_from_entries)
6267
main_canvas.create_window(200, 180, window=get_bmi_button)
6368

6469
# MAIN _LOOP
65-
root.mainloop()
70+
root.mainloop()

0 commit comments

Comments
 (0)