-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
92 lines (81 loc) · 1.67 KB
/
main.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
data = open('main.txt', 'r', encoding='UTF-8').read()
# Cucumber Alpha 1.0.4
print('Cucumber Alpha 1.0.4\nMade by watakak | https://github.com/watakak/Cucumber\n\n'
' Select the convert type:\n'
' 1. Convert to Cucumber\n'
' 2. Convert to Python')
convertType = input(' Input: ')
repl = {
# keywords
'print(': 'ā',
'input(': 'ā',
# another keywords
'def ': 'Å',
'func': 'Á',
'var': 'È',
'import ': 'Ñ',
' as ': 'Ó',
'from ': 'Ô',
# special characters
"('": 'ä',
"')": 'ë',
'("': 'Ä',
'")': 'Ë',
"(f'": 'Ê',
'(f"': 'Ë',
"):": 'É',
"}ë": 'Í',
"Æ{": 'Ù',
'\\n': 'Ï',
'(': 'Â',
')': 'Ã',
' = ': 'Ī',
': ': 'Æ',
', ': 'Ð',
# tabs, spaces
'\n\n\n\n': 'Ό',
'\n\n\n': 'Ή',
'\n\n': 'Έ',
'\n': 'Ά',
' ': 'ø',
# numbers
'000000': 'ဖ',
'00000': 'ပ',
'0000': 'ဎ',
'000': 'ခ',
'00': 'ဒ',
# letters
'ta': 'Ꭻ',
'te': 'Ꭺ',
'ti': 'Ꭹ',
'to': 'Ꭸ',
'tu': 'Ꭷ',
'ty': 'Ꭶ',
'tw': 'Ꭵ',
'st': 'Ꭴ',
'put': 'Ꭰ',
'In': 'Ꭱ',
'Out': 'Ꭲ',
'said': 'Ꭼ',
'You ': 'ค',
'on': 'Ç',
'int': '½',
'rand': 'ɲ',
'om': 'ȅ',
'number': 'ฃ',
'll': 'ฆ',
'He': 'ง',
'World': 'ฉ',
# combinations
'øāÂ': 'Ա',
'øāÊ': 'Բ'
}
if convertType == '1':
for key, value in repl.items():
data = data.replace(key, value)
elif convertType == '2':
for key, value in repl.items():
data = data.replace(value, key)
else:
print('Incorrect action!')
print(f'\n Output:\n{data}')