Skip to content

Commit 7dff851

Browse files
authored
Add files via upload
1 parent e22c147 commit 7dff851

File tree

7 files changed

+191
-0
lines changed

7 files changed

+191
-0
lines changed

Qr code genrator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import qrcode as qr
2+
3+
img =qr.make("https://youtu.be/au5uNkCKzaY?si=QemQTizyWGi72K43")
4+
img = img.save("qrcode.png")

ascii imagee gen.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from ascii_magic import AsciiArt
2+
3+
my_art = AsciiArt.from_image("tiger.jpg")
4+
my_art.to_terminal(columns=100,char='#')#adjust columns and char

desktop notifier.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from plyer import notification
2+
3+
import time
4+
5+
6+
if __name__ == '__main__':
7+
while True: # using loop for infinite time
8+
notification.notify(
9+
title="***take rest***",
10+
message="you have working for 2 hours take a small break otherwise you will get sick",
11+
timeout=4) #only 4 seconds display the notification
12+
time.sleep(6) #set time according to you get notifiy
13+

dice simulator.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import tkinter as tk #importing tkinter
2+
from PIL import Image, ImageTk #importing pillow
3+
import random #importing random
4+
5+
6+
window =tk.Tk()
7+
window.geometry("1000x1000")
8+
window.title("dice roll")
9+
10+
11+
12+
dice =["dice1.jpg","dice2.jpg","dice3.jpg","dice4.jpg","dice5.jpg","dice6.jpg"]#list of dice images
13+
14+
image1= ImageTk.PhotoImage(Image.open(random.choice(dice)))#randomly choose one image from the list of the dice images
15+
image2= ImageTk.PhotoImage(Image.open(random.choice(dice)))
16+
17+
18+
19+
label1=tk.Label(window,image=image1)#create a label to display the images
20+
label2=tk.Label(window,image=image2)
21+
22+
23+
24+
label1.image =image1#keep a refrence of the image
25+
label2.image =image2
26+
27+
28+
label1.place(x=10,y=20) #placing the images on the screen
29+
label2.place(x=700,y=20)
30+
31+
32+
#function to roll the dice
33+
def roll_dice():
34+
image1 =ImageTk.PhotoImage(Image.open(random.choice(dice)))
35+
label1.configure(image=image1)
36+
label1.image=image1
37+
38+
39+
image2 =ImageTk.PhotoImage(Image.open(random.choice(dice)))
40+
label2.configure(image=image2)
41+
label2.image=image2
42+
43+
44+
45+
46+
button = tk.Button(window,text="Roll",bg="red",foreground="black",font="times 20 bold",command=roll_dice)
47+
48+
button.place(x=550,y=5,height=40,width=200)#placing the button on the scren
49+
50+
51+
52+
window.mainloop()

email checker.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import re #regex
2+
3+
#email validate checker
4+
5+
def validate_email(email):
6+
email_conditions = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$"
7+
if re.search(email_conditions, email):
8+
return True
9+
else:
10+
return False
11+
12+
user_email = input("Enter email here: ")
13+
if validate_email(user_email):
14+
print("Valid email id")
15+
else:
16+
print("Please enter a valid email id")

shut down app.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
from tkinter import*
2+
import os
3+
4+
5+
6+
def restart():#restart the system
7+
os.system("shutdown /r /t 1")
8+
9+
def restart_time():
10+
os.system("shutdown /r /t 20")
11+
12+
13+
def logout():
14+
os.system("shutdown -1")
15+
16+
17+
def shutdown():
18+
os.system("shutdown /s /t 1")
19+
20+
st=Tk()
21+
st.title("shut down app")
22+
st.geometry("1000x980")
23+
st.config(bg="black")
24+
25+
r_button=Button(st,text="restart",font=("times new roman",28,'bold')
26+
,relief=RAISED,cursor="plus",command=restart)
27+
r_button.place(x=385,y=80,height='70',width='200')
28+
29+
30+
31+
r_button=Button(st,text="restart time",font=("times new roman",25,'bold')
32+
,relief=RAISED,cursor="plus",command=restart_time)
33+
r_button.place(x=360,y=200,height='70',width='250')
34+
35+
36+
r_button=Button(st,text="log out",font=("times new roman",25,'bold')
37+
,relief=RAISED,cursor="plus",command=logout)
38+
r_button.place(x=360,y=330,height='70',width='250')
39+
40+
41+
r_button=Button(st,text="shut down",font=("times new roman",25,'bold')
42+
,relief=RAISED,cursor="plus",command=shutdown)
43+
r_button.place(x=360,y=455,height='70',width='250')
44+
45+
46+
47+
st.mainloop()

simple calculator.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
def calculate():
2+
3+
a = float(input("Enter the first number: "))
4+
b = float(input("Enter the second number: "))
5+
6+
7+
operations = ['+', '-', '*', '/']
8+
9+
10+
operation = input('''
11+
+ for addition
12+
- for subtraction
13+
* for multiplication
14+
/ for division
15+
''')
16+
17+
18+
if operation == '+':
19+
print('{} + {} = '.format(a, b))
20+
print(a + b)
21+
22+
elif operation == '-':
23+
print('{} - {} = '.format(a, b))
24+
print(a - b)
25+
26+
elif operation == '*':
27+
print('{} * {} = '.format(a, b))
28+
print(a * b)
29+
30+
elif operation == '/':
31+
print('{} / {} = '.format(a, b))
32+
print(a / b)
33+
34+
else:
35+
print('You have not typed a valid operator, please run the program again.')
36+
37+
38+
def again():
39+
40+
41+
calc_again = input('''
42+
Do you want to calculate again?
43+
Please type Y for YES or N for NO.
44+
''')
45+
46+
47+
if calc_again.upper() == 'Y':
48+
calculate()
49+
elif calc_again.upper() == 'N':
50+
print('See you later.')
51+
else:
52+
again()
53+
54+
calculate()
55+
again()

0 commit comments

Comments
 (0)