python读取txt文件中的字符串,找出字符串中的数字,并输出为字符串
file = open('route')
content = file.read()
s = [i for i in content if str.isdigit(i)]
s2 = ''.join(s)
print(s2)
python读取txt文件中的字符串,找出字符串中的数字,并输出为字符串
file = open('route')
content = file.read()
s = [i for i in content if str.isdigit(i)]
s2 = ''.join(s)
print(s2)