的字符串,也許這 ipath= "./data/NCDC/上海/虹橋/9705626661750dat.txt"
或本 ipath = './data/NCDC/ciampino/6240476818161dat.txt'
我怎麼知道第一個字符串包含中國? 我覺得這個答案也許有幫助: Find all Chinese text in a string using Python and Re
在Learn Python the Hard Way的示例5中,我遇到了一個問題。我繼續前進,將英寸換算成釐米,磅數換算成公斤。儘管格式化程序和語法錯誤讀取爲not all arguments converted during string formatting,但我遇到了一個錯誤。我的英寸釐米和磅到公斤很好,但它沒有顯示在字符串中的變量。它看起來像這樣: print "%s is", cm, "