python读取txt文件中的字符串,并将其中的数字输出

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