IO编程

一StringIO和BytesIO

  原文地址:https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/001431918785710e86a1a120ce04925bae155012c7fc71e000

  应用场景:数据读写的不是文件,而是在内存中读写。

  StringIO顾名思义就是在内存中读写str。

  BytesIO就是在内存中读写二进制数据。

  方法:

    getvalue()

    f=BytesIO()

    f.write('')

    print(f.getvalue())

    

  

原文地址:https://www.cnblogs.com/654321cc/p/8059393.html