-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFileMenuExample.py
More file actions
95 lines (73 loc) · 3.1 KB
/
FileMenuExample.py
File metadata and controls
95 lines (73 loc) · 3.1 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
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
# You will need to import your own files to correctly make this Python \
# file menu program example work. You can also use some of my program \
# examples to create a working Python file menu of your very own.
import os,time,winsound
from secpoem import secret_poem
from ASCIIcharacterguide import ascii_codes
from FantastiquePlastique import fan_plast
from MajesticCalculator import maj_cal
from ONTARIOLOTO import ont_lotto
from TypeGame import type_game
text_features=(
'cls', # index 0 = clear screen
' '*45, # index 1 = 45 spaces
'*'*118, # index 2 = 118 asterisks
'\x1b[31m', # index 3 = red
'\x1b[32m', # index 4 = green
'\x1b[33m', # index 5 = yellow
'\x1b[34m', # index 6 = blue
'\x1b[37m' # index 7 = white
)
sounds=('Ring05','Ring06')
text_words=(
f'\n{text_features[1]}{text_features[5]}J.C.R \
Soft{text_features[4]}~{text_features[5]}Choice', # index 0 = text_words
f'\n{text_features[4]}{text_features[2]}', # index 1 = text_words
f'\n{text_features[5]}To open a choice, press any one of \
the selected number keys below, then press \
({text_features[3]}ENTER{text_features[5]}) to confirm.', # index 2 = text_words
f'\n({text_features[4]}1{text_features[5]}): ASCII CODE \
TRANSLATOR', # index 3 = text_words
f'\n({text_features[4]}2{text_features[5]}): FANTASTIQUE \
PLASTIQUE Easy Mix Converter', # index 4 = text_words
f'\n({text_features[4]}3{text_features[5]}): Majestic Calculator', # index 5 = text_words
f'\n({text_features[4]}4{text_features[5]}): ONTARIO LOTTO \
6/49 RANDOM NUMBER GENERATOR', # index 6 = text_words
f'\n({text_features[4]}5{text_features[5]}): Typewriter Game', # index 7 = text_words
f'\nPress ({text_features[3]}Q{text_features[5]}) to \
exit J.C.R Soft~Choice.' # index 8 = text_words
)
text_info=(
f'\n{text_features[3]}READY:{text_features[4]}', # index 0 = text_info
f'\n{text_features[5]}Thanks for choosing J.C.R Soft~Choice.', # index 1 = text_info
'title J.C.R Soft~Choice', # index 2 = text_info
'knowledge' # index 3 = text_info
)
choice=('1','2','3','4','5','q') # choices, q = quit
def file_menu():
winsound.PlaySound(sounds[0],winsound.SND_ASYNC)
while True:
os.system(text_info[2])
os.system(text_features[0])
for i in text_words:
print(i)
button=input(text_info[0]).lower().strip()
if button==(text_info[3]):
secret_poem()
elif button==(choice[0]):
ascii_codes()
elif button==(choice[1]):
fan_plast()
elif button==(choice[2]):
maj_cal()
elif button==(choice[3]):
ont_lotto()
elif button==(choice[4]):
type_game()
elif button==(choice[5]):
os.system(text_features[0])
winsound.PlaySound(sounds[1],winsound.SND_ASYNC)
print(text_info[1])
time.sleep(3)
break
file_menu()