Skip to content

Commit ba03c0a

Browse files
Merge pull request #2717 from avinashkranjan/deepsource-transform-1175db56
format code with autopep8
2 parents 12b2935 + 458407c commit ba03c0a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Advisor_App/advice.py

Lines changed: 7 additions & 2 deletions
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)