Skip to content

Commit

Permalink
Merge pull request #285 from otahina/main
Browse files Browse the repository at this point in the history
Modified the clear screen function to work with different OS.
  • Loading branch information
Mrinank-Bhowmick authored Jul 13, 2023
2 parents f557cea + fb4cdd4 commit 5f31357
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions projects/AES256/AES256.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
import os
from Cryptodome.Cipher import AES
from Cryptodome.Random import get_random_bytes
import platform


os.system("cls")
#For different OS
if platform.system() == "Windows":
os.system("cls")
else:
os.system("clear")


# Start of Encryption Function
Expand Down
12 changes: 6 additions & 6 deletions projects/Alarm Clock/alarm_clock.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from tkinter import *
import datetime
import time
import winsound
from threading import *
from pygame import mixer

# create object
root = Tk()
Expand All @@ -29,11 +29,12 @@ def alarm():
if current_time == set_alarm_time:
print("Wake Up now!")
# play sound continuously
winsound.PlaySound(
"sound.wav",
winsound.SND_ASYNC | winsound.SND_LOOP | winsound.SND_FILENAME,
)
mixer.init()
mixer.music.load('sound.wav')
mixer.music.play()

def stop_alarm():
mixer.music.stop()

Label(root, text="Alarm Clock", font=("Helvetica 20 bold"), fg="red").pack(pady=10)
Label(root, text="Set Time", font=("Helvetica 15 bold")).pack()
Expand Down Expand Up @@ -214,7 +215,6 @@ def alarm():

Button(root, text="Set Alarm", font=("Helvetica 15"), command=Threading).pack(pady=20)

stop_alarm = lambda: winsound.PlaySound(None, winsound.SND_PURGE)
button = Button(root, text="Stop Alarm", bg="red", fg="white", command=stop_alarm).pack(
pady=30
)
Expand Down
Binary file added projects/Alarm Clock/sound.wav
Binary file not shown.

0 comments on commit 5f31357

Please sign in to comment.