python读写内存数据
# -*- coding:utf-8 -*-
from io import StringIO,BytesIO
f=StringIO("Hello,EveryOne.\nMy name is Joannes.\n")
while True:
r=f.readline()
if r=="":
break
print(r.strip())
b=BytesIO("我的名字叫Joannes\n老骥伏枥,志在千里".encode('utf-8'))
while True:
_b=b.readline()
if _b==b"":
break
print(_b.decode('utf-8').strip())
思考:读写内存数据优劣

浙公网安备 33010602011771号