Python 读写字节数据(转)
转自:Python 读写字节数据使用模式为rb或wb的open()函数来读取或写入二进制数据。比如:# Read the entire file as a single byte stringwith open('somefile.bin', 'rb') as f: data = f.read() # Write binary data to a filewit...