Skip to content

Commit 458407c

Browse files
style: format code with autopep8
Format code with autopep8 This commit fixes the style issues introduced in 6b742c7 according to the output from Autopep8. Details: None
1 parent 6b742c7 commit 458407c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Advisor_App/advice.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,25 @@
44
from tkinter import messagebox
55

66
# Fetching advice from the advice api
7+
8+
79
def advice():
810
try:
911
res = requests.get("https://api.adviceslip.com/advice").json()
1012
advice_text.set(res["slip"]["advice"])
1113
except requests.exceptions.RequestException:
12-
messagebox.showerror("Error", "Failed to fetch advice. Please check your internet connection.")
14+
messagebox.showerror(
15+
"Error", "Failed to fetch advice. Please check your internet connection.")
16+
1317

1418
# Create the main window
1519
root = tk.Tk()
1620
root.title("Random Advisor Application")
1721

1822
# Create and configure widgets
1923
advice_text = tk.StringVar()
20-
advice_label = tk.Label(root, textvariable=advice_text, wraplength=400, font=("Arial", 14))
24+
advice_label = tk.Label(root, textvariable=advice_text,
25+
wraplength=400, font=("Arial", 14))
2126
get_advice_button = tk.Button(root, text="Get Advice", command=advice)
2227

2328
# Pack widgets

0 commit comments

Comments
 (0)