蜘蛛纸牌存档修改——python3.4.3

时间:2015-05-12 13:20:08   收藏:0   阅读:215
 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 ‘‘‘

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!