Skip to content

Домашнее задание 9. Код Хаффмана. Разгуляева А.И. #8

Open
ada1ra wants to merge 2 commits intomainfrom
hw_9_huffman
Open

Домашнее задание 9. Код Хаффмана. Разгуляева А.И. #8
ada1ra wants to merge 2 commits intomainfrom
hw_9_huffman

Conversation

@ada1ra
Copy link
Owner

@ada1ra ada1ra commented Nov 16, 2025

No description provided.

@ada1ra ada1ra requested a review from chernishev November 16, 2025 19:42
Comment on lines +78 to +86
# записываем специальные символы, чтобы не ломался формат
if char == '\n':
char_escaped = '\\n'
elif char == '\t':
char_escaped = '\\t'
elif char == '\\':
char_escaped = '\\\\'
else:
char_escaped = char

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лучше сделать через словарь или switch case

Comment on lines +106 to +114
# восстанавливаем специальные символы
if char_escaped == '\\n':
char = '\n'
elif char_escaped == '\\t':
char = '\t'
elif char_escaped == '\\\\':
char = '\\'
else:
char = char_escaped

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

То же что и в прошлом коммите

@Sneper-Breeze
Copy link

Неккоректно работают функции записи в файл бинарным способом, код
encode_to_file('hellow', 'output') print(decode_from_file_bin('output'))
вызывает ошибку, а так быть не должно.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants