Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个霍夫曼编码程序来压缩文本文件。我将文本文件转换为其霍夫曼编码值,我需要将其写入文件。我目前正在使用python“BitVector”模块,但是在读取和写入文件时速度太慢了。有没有其他方法可以做到这一点(最好更快)?
谢谢。
您可以考虑使用 python 标准库中的struct 包。