-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecode.py
More file actions
28 lines (27 loc) · 733 Bytes
/
decode.py
File metadata and controls
28 lines (27 loc) · 733 Bytes
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
#!/usr/bin/python
import os
import sys
e=''
counter=0
encode = { '!':'a', '@':'h', '#':'j', '$':'t', '%':'l', '/':'e', '_':'f', '-':'i', '0':'b', '1':'c', '2':'d', '3':'g', '4':'p', '5':'q', '6':'r', '7':'s', '8':'u', '9':'o', 'a':'k', 'b':'m' , 'c':'n', 'd':'v', 'e':'w', 'f':'x', 'g':'y', 'h':'z'}
data=open(sys.argv[1], 'r')
for each_line in range(0,10000):
d=data.readline()
for i in range(0, len(d)):
if d[i] not in encode and d[i]!='|':
e=e+d[i]
continue
elif d[i]=='|' or d[i-1]=='|':
counter=counter+1
if counter==4:
counter=0
e=e+d[i]
else:
continue
continue
elif d[i] in encode and d[i]!='|':
e=e+encode[d[i]]
data.close()
data=open(sys.argv[1],'w')
data.write(e)
data.close()