-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
48 lines (46 loc) · 1.66 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
char_to_emoji = {
'a': ':regional_indicator_a:',
'b': ':regional_indicator_b:',
'c': ':regional_indicator_c:',
'd': ':regional_indicator_d:',
'e': ':regional_indicator_e:',
'f': ':regional_indicator_f:',
'g': ':regional_indicator_g:',
'h': ':regional_indicator_h:',
'i': ':regional_indicator_i:',
'j': ':regional_indicator_j:',
'k': ':regional_indicator_k:',
'l': ':regional_indicator_l:',
'm': ':regional_indicator_m:',
'n': ':regional_indicator_n:',
'o': ':regional_indicator_o:',
'p': ':regional_indicator_p:',
'q': ':regional_indicator_q:',
'r': ':regional_indicator_r:',
's': ':regional_indicator_s:',
't': ':regional_indicator_t:',
'u': ':regional_indicator_u:',
'v': ':regional_indicator_v:',
'w': ':regional_indicator_w:',
'x': ':regional_indicator_x:',
'y': ':regional_indicator_y:',
'z': ':regional_indicator_z:',
}
import subprocess
def ironmaceHatesMe(text):
text = text.lower() # Convert text to lowercase
lines = text.split('|') # Split text into lines at '|' characters
transformed_lines = []
for line in lines:
transformed_text = []
for char in line:
if char in char_to_emoji:
transformed_text.append(char_to_emoji[char])
else:
transformed_text.append(char) # Keep non-alphabetical characters as-is
transformed_lines.append(''.join(transformed_text))
return '\n'.join(transformed_lines)
if __name__ == '__main__':
out = ironmaceHatesMe(input('Text: '))
subprocess.run('clip', input=out.encode('utf-8'), check=True)
print(f'Copied:\n{out}\nto your clipboard!')