Прога для копипасты :0
This commit is contained in:
16
decode.py
16
decode.py
@@ -6,12 +6,26 @@ def fix_encoding(text):
|
|||||||
fixed_text = fixed_text.replace("ј", "ё")
|
fixed_text = fixed_text.replace("ј", "ё")
|
||||||
fixed_text = fixed_text.replace("ѕ", "<<")
|
fixed_text = fixed_text.replace("ѕ", "<<")
|
||||||
fixed_text = fixed_text.replace("ї", ">>")
|
fixed_text = fixed_text.replace("ї", ">>")
|
||||||
|
fixed_text = fixed_text.replace("\x16", "--")
|
||||||
|
fixed_text = fixed_text.replace("\x10", "<<")
|
||||||
|
fixed_text = fixed_text.replace("\x11", ">>")
|
||||||
return fixed_text
|
return fixed_text
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
while True:
|
while True:
|
||||||
corrupted_text = input("Введите искажённый текст: ")
|
print("Введите искажённый текст и нажмите enter:")
|
||||||
|
|
||||||
|
text_lines = []
|
||||||
|
while True:
|
||||||
|
line = input()
|
||||||
|
if line == "":
|
||||||
|
# Если строка пустая, это означает, что пользователь сделал
|
||||||
|
# двойной перенос строки.
|
||||||
|
break
|
||||||
|
text_lines.append(line)
|
||||||
|
|
||||||
|
corrupted_text = "\n".join(text_lines)
|
||||||
|
|
||||||
print()
|
print()
|
||||||
print(fix_encoding(corrupted_text))
|
print(fix_encoding(corrupted_text))
|
||||||
|
|||||||
Reference in New Issue
Block a user