hello, i am new in python. I try to make a programm wich translate russian pattern in german pattern. It works but not in all words. Why?
[Image: out-txt-tmp.jpg]
1 2 3 4 5 6 7 8 9 10 |
f1 = open ( 'wolf.txt' , 'r' ) f2 = open ( 'out.txt.tmp' , 'w' ) for line in f1: f2.write(line.replace( 'ряд:' , 'Runde:' )) f2.write(line.replace( 'сбн,' , 'fM,' )) f2.write(line.replace( 'повторить' , '*' )) f2.write(line.replace( 'раз' , ' ' )) f2.write(line.replace( '[12сбн]' , '[12]' )) f1.close() f2.close() |
Larz60+ write Mar-01-2021, 11:16 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.