import dpkt with open('read_test.pcap','rb') as fr: reader = dpkt.pcap.Reader(fr) for ts,pkt in reader.readpkts(): pass # ts:时间戳 # pkt:二进制数据包 写文件 import dpkt with open('write_test.pcap','wb') as fw: writer = dpkt.pcap.Writer(fw) writer.writepkt(pkt) # 参数...