在使用os.listdir(r"C:\中文路徑")時會提示亂碼問題.
import os
pathname = r"D:\中文路徑"
paths = os.listdir(pathname.encode("gbk").decode("utf-8"))
在使用os.listdir(r"C:\中文路徑")時會提示亂碼問題.
import os
pathname = r"D:\中文路徑"
paths = os.listdir(pathname.encode("gbk").decode("utf-8"))
1.while循環的格式 while 條件: 條件滿足時,做的事情1 條件滿足時,做的事情2 條件滿足時,做的事情3 ...(省略)... demo