1 #encoding:utf-8 2 import struct 3 4 myfile = open("D:\\Backup\\我的文档\\spider.sav","rb+") 5 6 myfile.seek(368,0) 7 myfile.write(struct.pack(‘I‘,1000)) 8 9 myfile.seek(368,0) 10 value = struct.unpack(‘I‘,myfile.read(4))[0] #I占4位 11 12 print (value) 13 myfile.close() 14 ‘‘‘ 15 源码保存为utf-8无BOM格式 16 ‘‘‘
时间: 2024-11-07 15:01:16