-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun.py
110 lines (100 loc) · 2.97 KB
/
run.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
from place_formatter import place
import os
import time
clear = lambda: os.system('cls')
menu_options = {
0: 'Requirements',
1: 'Tutorial',
2: 'Make my Sprite',
3: 'Credit',
4: 'Exit',
}
def print_menu():
print('|| Reddit Place Image Formatter ||')
print('')
for key in menu_options.keys():
print (key, '--', menu_options[key] )
print('')
def option1():
clear()
print('')
time.sleep(1)
print("To create a pixelated image it's very simple ! (Really)")
print("Simply add your image in the software file source.")
print('***It is recommended to use a png image')
time.sleep(5)
print('')
print('')
def option0():
clear()
print('')
time.sleep(1)
print("||| Mandatory dependencies |||")
print('numpy = 1.22.3')
print('')
print("opencv_python = 4.5.5.64")
print('')
print('scikit_learn = 1.0.2')
time.sleep(5)
print('')
print('')
# IMPORTANT
def option2():
clear()
nameFile = ''
extensionFile = ''
print('')
nameFile = input('Please enter the name of your file : ')
print('')
extensionFile = input('Please enter the extension of your file : ')
print('')
width_pixel_size = int(input('Please enter the size of desired width by pixels: '))
PATH = './' + nameFile + '.' + extensionFile
if os.path.isfile(PATH) and os.access(PATH, os.R_OK):
print("We will now update your file")
image_path = r""+ nameFile + '.' + extensionFile # name of file if it is in same directory or path to file
show_grids_at_output = True # option to turn on or off grids at output
place(image_path, width_pixel_size, show_grids_at_output) # main function call
else:
print("Either the file is missing or not readable")
time.sleep(3)
option2()
def option3():
clear()
print('')
time.sleep(1)
print('Created by : rtakak')
print('')
print('Contributions by : Maxime66410 & mikesingleton')
time.sleep(3)
print('')
print('')
if __name__ == "__main__":
while(True):
print_menu()
option = ''
try:
option = int(input('Enter your choice: '))
except:
clear()
print('')
print('Wrong input. Please enter a number ...')
print('')
if option == 1:
option1()
elif option == 2:
option2()
elif option == 3:
option3()
elif option == 4:
clear()
print('Thank you for using the software and contributing to reddit Place !')
time.sleep(3)
exit()
elif option == 0:
option0()
else:
clear()
print('')
print('Invalid option. Please enter a number between 1 and 4.')
print('')