-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.py
More file actions
53 lines (40 loc) · 1.34 KB
/
types.py
File metadata and controls
53 lines (40 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from enum import Enum
import matplotlib.pyplot as plt
from PIL import Image
import requests
from io import BytesIO
def standerd():
URL = "https://flyclipart.com/thumb2/youtube-like-button-png-394953.png"
response = requests.get(URL)
img = Image.open(BytesIO(response.content))
plt.imshow(img)
plt.axis('off')
plt.show()
def filled():
URL = "https://www.shutterstock.com/shutterstock/photos/1293572980/display_1500/stock-vector-hand-with-thumb-up-like-linear-outline-icon-sticker-style-with-white-border-and-simple-shadow-on-1293572980.jpg"
response = requests.get(URL)
img = Image.open(BytesIO(response.content))
plt.imshow(img)
plt.axis('off')
plt.show()
class State(Enum):
neutral = "neutral"
on_click = "on_click"
class Button():
def __init__(self):
self.like = State.on_click
self.unlike = State.neutral
self.standerd = State.neutral
def conditions(self, choice):
if choice == 1:
print("You liked it!")
filled()
elif choice == 2:
print("You unliked it!")
standerd()
else:
print("Invalid choice")
print("\033[1;32mPLEASE LIKE MY PROGRAMS\033[0m")
choice = int(input("\033[1;34m 1. like\n2. unlike\n"))
b = Button()
b.conditions(choice)