Skip to content

Commit 5385aa4

Browse files
committed
python prg
1 parent 461279b commit 5385aa4

File tree

16 files changed

+868
-2
lines changed

16 files changed

+868
-2
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

eng_clock/clock.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import tkinter as tk
2+
from time import strftime
3+
import pygame
4+
5+
# Initialize Pygame mixer
6+
pygame.mixer.init()
7+
8+
# Load the sound
9+
dong_sound = pygame.mixer.Sound("dong.wav")
10+
11+
# Create the main window
12+
root = tk.Tk()
13+
root.title("ENGclk")
14+
15+
# Customize the window size and make it non-resizable
16+
root.geometry("410x130") # Width x Height
17+
root.resizable(0, 0) # Disable resizing
18+
19+
# Styling the clock to resemble a code editor
20+
background_color = '#000000' # Black background
21+
normal_color = '#00FF00' # Green color for normal time
22+
hex_color = '#0000FF' # Blue color for hexadecimal time
23+
binary_color = '#FF0000' # Red color for binary time
24+
25+
# Configure the main window's background color
26+
root.configure(bg=background_color)
27+
28+
# Function to convert time to hexadecimal
29+
def time_to_hex(time_str):
30+
return ':'.join(f'{int(part):02X}' for part in time_str.split(':'))
31+
32+
# Function to convert time to binary
33+
def time_to_binary(time_str):
34+
return ' '.join(f'{int(part):08b}' for part in time_str.split(':'))
35+
36+
# Function to update time
37+
def update_time():
38+
current_time = strftime('%H:%M:%S') # 24-hour format with seconds
39+
if current_time.endswith("00:00"): # Play sound every hour on the hour
40+
pygame.mixer.Sound.play(dong_sound)
41+
42+
hex_time = time_to_hex(current_time) # Convert to hexadecimal
43+
binary_time = time_to_binary(current_time) # Convert to binary
44+
45+
# Set the time display with different colors and sizes
46+
hex_display.config(text=hex_time)
47+
time_display.config(text=current_time)
48+
binary_display.config(text=binary_time)
49+
50+
# Schedule this function to be called every second
51+
root.after(1000, update_time)
52+
53+
# Define the fonts
54+
hex_font = ('Consolas', 30, 'bold') # Larger font for hexadecimal
55+
normal_font = ('Consolas', 20)
56+
binary_font = ('Consolas', 20)
57+
58+
# Labels for displaying the time
59+
hex_display = tk.Label(root, font=hex_font, bg=background_color, fg=hex_color, padx=0, pady=0)
60+
hex_display.pack(fill='x', anchor='w')
61+
62+
time_display = tk.Label(root, font=normal_font, bg=background_color, fg=normal_color, padx=0, pady=0)
63+
time_display.pack(fill='x', anchor='w')
64+
65+
binary_display = tk.Label(root, font=binary_font, bg=background_color, fg=binary_color, padx=0, pady=0)
66+
binary_display.pack(fill='x', anchor='w')
67+
68+
# Start the time update loop
69+
update_time()
70+
71+
# Start the Tkinter event loop
72+
root.mainloop()

eng_clock/clock_icon.ico

4.19 KB
Binary file not shown.

eng_clock/dong.wav

367 KB
Binary file not shown.

grad_counter/grad.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import tkinter as tk
2+
from datetime import datetime, timedelta
3+
from PIL import Image, ImageTk
4+
import pytz
5+
6+
def update_time():
7+
now = datetime.now(pytz.timezone('America/Los_Angeles'))
8+
target = datetime(2024, 6, 14, 0, 0, tzinfo=pytz.timezone('America/Los_Angeles'))
9+
remaining = target - now
10+
if remaining < timedelta(0):
11+
remaining = timedelta(0) # Timer will not go negative
12+
days = remaining.days
13+
seconds = remaining.seconds
14+
hours, remainder = divmod(remaining.seconds, 3600)
15+
minutes, seconds = divmod(remainder, 60)
16+
timer_str = f"{days} days {hours:02}:{minutes:02}:{seconds:02}"
17+
time_label.config(text=timer_str)
18+
root.after(1000, update_time) # Update the label every second
19+
20+
root = tk.Tk()
21+
root.title("Countdown to Graduation")
22+
23+
# Set the geometry of the tkinter window
24+
root.geometry("400x450")
25+
26+
# Load an image using PIL's Image module
27+
graduate_image = Image.open("C:\\Users\\walka\\Desktop\\git\\grad_count\\graduate_image.png")
28+
graduate_image = graduate_image.resize((400, 400), Image.Resampling.LANCZOS)
29+
graduate_image_img = ImageTk.PhotoImage(graduate_image)
30+
31+
# Create a Label for the image
32+
graduate_label = tk.Label(root, image=graduate_image_img)
33+
graduate_label.pack()
34+
35+
# Create a Label for the countdown timer with a modern and bold font
36+
time_label = tk.Label(root, font=('Helvetica', 35, 'bold'), fg='green')
37+
time_label.pack()
38+
39+
# Start updating the time immediately
40+
update_time()
41+
42+
root.mainloop()

grad_counter/graduate_image.png

1.04 MB
Loading

grad_counter/psu_logo.png

87.6 KB
Loading

kernel/character_driver

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit da4ca399ee785c31ea0c05ba20c104f1b84e500d

kernel/hello_linux

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 7689199b270b4830ffba4366c819f6d89a57d4dc

myResume.pdf

-113 KB
Binary file not shown.

0 commit comments

Comments
 (0)