Python中的网络共享文件夹的listdir

时间:2016-07-15 15:28:44

标签: python networking operating-system share listdir

我有一个文件路径为:C\\Local_Reports的网络共享文件夹。我想使用os.listdir(":C\\Local_Reports"),但输出为['desktop.ini', 'target.lnk']。这显然不是正确的输出。正确的输出是[Daemons, Reports, SQL]。我如何成功访问此内容?

1 个答案:

答案 0 :(得分:0)

我很傻。我想到了。我刚刚获取了Local_Reports文件夹的目标并写了os.listdir(r"\\03vs-cmpt04\Local_Reports")。这只是在网络上搜索了该文件夹并列出了正确的输出:[Daemons, Reports, SQL]

相关问题