如果原始碼中寫了非ASCII 字元串,必須在第一行放置編碼聲明(encoding declaration)。例如: # coding=Big5 text = '測試' print len(text) # 顯示4.
確定! 回上一頁