参考 https://blog.csdn.net/weixin_38383877/article/details/81100192 在python3下使用struct模块代码 fileHead = struct.pack('128sl', os.path.basename(filePath),os.stat(filePath).st_size); 抛出异常: argument for 's' must be a bytes object必须要是字节类型. 解决办法: 把字符串的地方转为字节类型,
he struct module includes functions for converting between strings of bytes and native Python data types such as numbers and strings. Functions vs. Struct Class There are a set of module-level functions for working with structured values, and there i