Created
October 31, 2013 12:19
-
-
Save zhongwuzw/7248748 to your computer and use it in GitHub Desktop.
学习python编写的第一个脚本,纪念一下。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
f = open("C:/Users/laicai/Desktop/a.txt","r") | |
f1 = open("C:/Users/laicai/Desktop/zhongwu.txt","w") | |
for line in f: | |
pattern = re.compile(r'\b(91\w*)') | |
temp = pattern.search(line).groups() | |
f1.write("'0x") | |
f1.write(temp[0]) | |
f1.write("',") | |
f.close() | |
f1.close() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment