抄了一段代码,报错
import base64
import StringIO
a="this a test"
b=base64.encodestring(a)
print(b)
import StringIO
ImportError: No module named 'StringIO' 检查一下python 安装主目录下的lib目录下有没有StringIO.py文件,如果没有此文件的话, 重新安装,有这个文件的话,检查一下环境变量设置。 貌似这一段不用import StringIO吧 What’s New In Python 3.0
......
The StringIO and cStringIO modules are gone. Instead, import the io module and use io.StringIO or io.BytesIO for text and data respectively.
...... 还真的没有这个文件 python please output this command.
页:
[1]