标签:blog http io os ar for sp div on
怎么获取 [ ]中的字符串或者数字
http://stackoverflow.com/questions/4894069/python-regex-help-return-text-between-parenthesis
例程:
[[ 1.1916991]]
[[ 0.87677399]]
[[ 0.69110944]]
[[ 0.65589256]]
def readTxtToList(): fp_read = open("readTest.txt", "r") readNum = [] for line in fp_read: readNum = line[line.find("[")+1:line.find("]")] print readNum readNum = readNum[readNum.find("[")+1:] print readNum fp_read.close() readTxtToList()
标签:blog http io os ar for sp div on
原文地址:http://www.cnblogs.com/hope100/p/4036469.html