【发布时间】:2016-06-07 16:24:36
【问题描述】:
我有一个包含几个 xml 文件的 DFS 网络共享,我编写了一个 python 脚本,它将使用 glob 获取我的 xml 文件
以下是我的DFS结构
├─ O
├──── my_path
| ├── test1.xml
| ├── test1.xml
| └── test2.xml
以下是我的代码:
import glob
path = 'O:\\my_path\\*.xml'
files = glob.glob(path)
print 'Files found: {}'.format(len(files))
当我通过命令行运行它时,一切正常。
python test.py
> Files found: 3
但是,当我通过命令行管理员模式运行它时,它无法正常工作
python test.py
> Files found: 0
glob 在管理员模式下无法正常工作的原因是什么?解决方法是什么?
【问题讨论】: