Skip to content

Commit

Permalink
Fix code style issues with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
lint-action committed Feb 10, 2024
1 parent 1fd285e commit 650f1aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion projects/Alarm Clock/clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
top.title("Dynamic Clock") # Updated title
top.resizable(0, 0) # Making the window non-resizable


# Function to determine the time of day
def get_time_of_day(hour):
if 5 <= hour < 12:
Expand All @@ -15,6 +16,7 @@ def get_time_of_day(hour):
else:
return "Evening"


# Function to update the time display
def update_time():
current_time = strftime("%H:%M:%S %p")
Expand All @@ -25,12 +27,17 @@ def update_time():
clock_time.config(text=current_time + f"\nGood {time_of_day}!")

# Dynamically change the background color based on time of day
color = "lightblue" if time_of_day == "Morning" else "lightyellow" if time_of_day == "Afternoon" else "lightcoral"
color = (
"lightblue"
if time_of_day == "Morning"
else "lightyellow" if time_of_day == "Afternoon" else "lightcoral"
)
top.configure(background=color)

# Schedule the update_time function to be called again after 1000 milliseconds (1 second)
clock_time.after(1000, update_time)


# Creating a Label widget to display the time
clock_time = tkinter.Label(
top,
Expand Down
3 changes: 3 additions & 0 deletions projects/Tile Matching/tile_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import random
from tkinter import messagebox


class TileMatchingGame:
def __init__(self, root, rows, columns):
self.root = root
Expand Down Expand Up @@ -125,6 +126,7 @@ def reset_game(self):
self.root.destroy()
main()


def main():
root = tk.Tk()
root.title("Tile Matching Game")
Expand All @@ -143,5 +145,6 @@ def main():

root.mainloop()


if __name__ == "__main__":
main()

0 comments on commit 650f1aa

Please sign in to comment.