python 获取中文文件名的输出

#coding:utf8

if __name__  == '__main__':
    srcfile = u"D:/测试路径/测试文件.txt"
    f = open(srcfile.encode('gbk'))
    for text in f.readlines():
        print text.decode('gbk')
    f.close()
原文地址:https://www.cnblogs.com/qingyuanjushi/p/9262805.html