【发布时间】:2012-11-03 02:07:48
【问题描述】:
subprocess.check_output(('/Applications/googlecl-0.9.13/build/scripts-2.7/google', 'docs', 'get', r'"重新评估请求"', r'--format', 'csv', r'/Users/myaccount/Desktop'), shell=True)
此代码不会拉下文档,但运行相同的行将在终端内工作。它可能没有时间完成?从命令行运行它需要一段时间。
有一个 Python 错误: “回溯(最近一次通话最后一次): 文件“/Users/myaccount/Desktop/reassess2.py”,第 17 行,在 subprocess.call('google docs get "Reassesment Request" --format csv /Users/myaccount/Desktop') 文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py”,第 493 行,调用中 返回 Popen(*popenargs, **kwargs).wait() init 中的文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py”,第 679 行 读错,写错) _execute_child 中的文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py”,第 1249 行 引发 child_exception OSError: [Errno 2] 没有这样的文件或目录"
当我尝试在 OSX 脚本中运行它时,我遇到了类似的问题: 当我运行 shell 脚本(运行上面的命令行)时,我得到: ?/Users/myaccount/Desktop/ReScript.sh ;出口; .csvloading 重新评估请求到 /users/myaccount/Desktop 登出
[处理完成]", 但实际上并没有下载任何文件。
OSX 山狮; 0.9.13 厘升; 2.0.17 gdata(我认为 - 不是最新的,而是与 cl 一起使用的)
感谢您的帮助!
【问题讨论】: