>>> import bz2
>>> bz2.compress('hi')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ryan/anaconda/lib/python3.4/bz2.py", line 498, in compress
return comp.compress(data) + comp.flush()
TypeError: 'str' does not support the buffer interface
我见过使用字符串作为输入的例子,但它对我不起作用