获取路径下的所有文件名 decode bytes in position 2-3: truncated \UXXXXXXXX escape

 
 
def get_all_filename_list(path):
    file_name_list = os.listdir(path)
    return file_name_list

path 路径前记得加r表示原始路径,不然会报错

decode bytes in position 2-3: truncated \UXXXXXXXX escape

如 path = r'C:\Users\ttttt\Desktop\work'

猜你喜欢

转载自blog.csdn.net/AaronPaul/article/details/80566086