'''
Title: 内存中的读写StringIO
Description: 

@author H.Yang
@email xhaimail@163.com
@date 2020/03/07
'''
from _io import StringIO

# 创建对象
f = StringIO()
f.write('hello')
f.write(' ')
f.write('world')
ret = f.getvalue()
print(ret)
print()

f = StringIO("abcdefghijk")
print(f.read(2))
print(f.readline())

25e4fd2fec8d66de913e08b8d7c0f385d29a62fc
<mask token>

<mask token>
f.write('hello')
f.write(' ')
f.write('world')
<mask token>
print(ret)
print()
<mask token>
print(f.read(2))
print(f.readline())

<mask token>
f = StringIO()
f.write('hello')
f.write(' ')
f.write('world')
ret = f.getvalue()
print(ret)
print()
f = StringIO('abcdefghijk')
print(f.read(2))
print(f.readline())

<mask token>
from _io import StringIO
f = StringIO()
f.write('hello')
f.write(' ')
f.write('world')
ret = f.getvalue()
print(ret)
print()
f = StringIO('abcdefghijk')
print(f.read(2))
print(f.readline())

'''
Title: 内存中的读写StringIO
Description: 

@author H.Yang
@email xhaimail@163.com
@date 2020/03/07
'''
from _io import StringIO

# 创建对象
f = StringIO()
f.write('hello')
f.write(' ')
f.write('world')
ret = f.getvalue()
print(ret)
print()

f = StringIO("abcdefghijk")
print(f.read(2))
print(f.readline())
