曼彻斯特解密
manchesterdecode.py
#!usr/bin/env python
#-*- coding:utf-8 -*-
f=open('manchester.txt','r')
f1=open('manchester1.txt','w')
for line in f.readlines():
content=''
for i in range(0,len(line),2):
if line[i:i+2]=='10':
content+='1'
else: #01
content+='0'
f1.write(content+'\n')
f.close()
f1.close()