python读写文件

import binascii
LIST= ["3130342e3233372e3134372e3139312038333636206166626434633133","3139322e3234312e3135332e33382038393337203631623461646533"]
def sayHello ():
    f = open(r"d:\12.txt","w+")
    count = 0
    for x in LIST:
        print binascii.unhexlify(x),
        count = count+1
        f.write(binascii.unhexlify(x))
    print count
    f.close()
#function
sayHello()  # call the function

 

posted on 2015-12-13 11:31  寻步  阅读(139)  评论(0编辑  收藏  举报