第4月第20天 python re xls2lua

1.

import re


replace_values = ['one', 'two', 'three']
replace_keys = [str(i) for i in xrange(1, 4)]
replace_dict = dict(zip(replace_keys, replace_values))

def replace(match):
    return replace_dict[match.group(0)]


string = '1 adfa fa 2 fafsa 3 adfaf'
print re.sub(r'(^|)[1-3]($|)', replace, string)

作者:孙竟
链接:https://www.zhihu.com/question/36596275/answer/68175650
来源:知乎
著作权归作者所有,转载请联系作者获得授权。

https://www.zhihu.com/question/36596275

2.

https://github.com/luzexi/xls2lua

https://github.com/wangshunping/Starup-Game-Python

https://www.zhihu.com/question/20263645

原文地址:https://www.cnblogs.com/javastart/p/6322888.html