Skip to content

Instantly share code, notes, and snippets.

@zhongwuzw
Created October 31, 2013 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhongwuzw/7248748 to your computer and use it in GitHub Desktop.
Save zhongwuzw/7248748 to your computer and use it in GitHub Desktop.
学习python编写的第一个脚本,纪念一下。
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