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)
相關文章
相關標籤/搜索