python 字节读写 2019-09-29 20:23:06 浏览数 (1) Read the entire file as a single byte stringwith open('somefile.bin', 'rb') as f: data = f.read()Write binary data to a filewith open('somefile.bin', 'wb') as f: f.write(b'Hello World') binary byte data file string 0 人点赞 上一篇:分享雷军22年前编写的代码