-sharp -*- coding: utf-8 -*-
import os
def file_name(file_dir):
L=[]
for root, dirs, files in os.walk(file_dir):
print files
def main():
path = os.getcwd()
file_list = file_name(path+"\img")
main()
Code as above
get the picture of the folder and print out the file name
the result shows the encoding
the results are as follows:
"2017\xd3\xc8\xc3\xdb\xdc\xf6\xb0\xd9\xc6\xda\xba\xcf\xbc\xaf \xc3\xc0\xc5\xae\xc8\xe7\xd4\xc6\xd6\xd8\xb0\xf5\xb8\xa3\xc0\xfb_0.jpg", "2017\xd3\xc8\xc3\xdb\xdc\xf6\xb0\xd9\xc6\xda\xba\xcf\xbc\xaf \xc3\xc0\xc5\xae\xc8\xe7\xd4\xc6\xd6\xd8\xb0\xf5\xb8\xa3\xc0\xfb_1.jpg",
I have found a lot of information about this on the Internet, but I still can"t solve it. Please give me some advice.