摘要: from io import StringIO a = StringIO.StringIO('title') a.write('content1\n') a.write('content2') a.seek(0) #必须指定文件指针位置到文件开头,否则无法读出数据 print a.read() a.close() #必须和文件一样关闭 mport String... 阅读全文
posted @ 2018-05-30 16:00 shmily3929 阅读(3453) 评论(0) 推荐(1) 编辑