Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- zdroj = open('preloz.mors','r')
- cil = open('prelozene.txt','w')
- x = ' '
- text=''
- pismenko=''
- pismenkoM=''
- prevX = ''
- mezera = ''
- dict = {"•-":'a',".-":'a',"-•••":'b',"-...":'b',"-•-•":'c',"-.-.":"c","-••":'d',"-..":"d","•":'e',".":"e","••-•":'f',"..-.":"f","--•":'g',"--.":"g","••••":'h',"....":"h","••":'i',"..":"i","•---":'j',".---":"j","-•-":'k',"-.-":"k","•-••":'l',".-..":"l","--":'m',"-•":'n',"-.":"n","---":'o',"•--•":'p',".--.":"p","--•-":'q',"--.-":"q","•-•":'r',".-.":"r","•••":'s',"...":"s","-":'t',"••-":'u',"..-":"u","•••-":'v',"...-":"v","•--":'w',".--":"w","-••-":'x',"-..-":"x","-•--":'y',"-.--":"y","--••":'z',"--..":"z","/":' ',"••--••":'?',"..--..":"?","--..--":",","--••--":",","---••":"8","••---":"2","-•-•-•":";","-----":"0","•----":"1","-•--•-":"(","--•••":"7","---•••":":","•••••":"5","-••••-":"-","--•••-":"!","----•":"9","•••--":"3","-••-•":"/","-••••":"6","••••-":"4","-•••-":"=","•--•-•":"@"};
- while(x!=''):
- x = zdroj.read(1)
- pismenko=''
- if (x=='/'):
- if (pismenkoM!=''):
- pismenko = dict[pismenkoM]
- pismenkoM=''
- text = text + pismenko
- mezera=mezera+'/'
- elif (x!=' '):
- pismenkoM = pismenkoM + x
- prevX = x
- if (x!='/' and x!=' '):
- mezera=''
- if (mezera == '//'):
- text = text + ' '
- mezera=''
- cil.write(str(text))
- cil.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement