-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpaint.py
41 lines (34 loc) · 1.16 KB
/
paint.py
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
import tkinter as tkinter
import modules.output as output
import modules.image_processing as image_processing
import modules.painting as painting
# Initialize Tkinter root widget
root = tkinter.Tk()
root.withdraw()
# Display main menu
output.printMenu()
menuSelection = input(" Main Menu | Choose: ")
# Custom image
if menuSelection in ["1", "01"]:
output.clear()
output.printCustom()
customSelection = input(" Custom Image | Choose: ")
if customSelection in ["1", "01"]:
image_pixels, image_name = image_processing.process_image_from_path()
elif customSelection in ["2", "02"]:
image_pixels, image_name = image_processing.process_image_from_url()
else:
output.clear()
quit()
painting.start_painting(image_pixels, image_name)
# Random Image
elif menuSelection in ["2", "02"]:
output.printRandom()
randomSelection = input(" Random Image | Choose: ")
image_pixels, image_name = image_processing.process_random_image(randomSelection)
painting.start_painting(image_pixels, image_name)
else:
if menuSelection != "99":
output.printError("Invalid option!")
output.clear()
quit()