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.
我正在从网络上下载以 .xz 结尾的文件。它说它们是 JSONstrean 文件。
有没有办法在 Python 中读取这些文件,例如 CSV 文件?
Python 有一个库lzma用于读写压缩文件
这是一个简单的运行代码
import lzma with lzma.open('filename.xz', mode='rt') as file: for line in file: print(line)