小编Rob*_* W.的帖子

python tar文件如何将文件提取到流中

我试图提取一个压缩文件夹,但不是直接使用.extractall(),我想将文件解压缩为流,以便我可以自己处理流.是否可以使用它tarfile?或者有什么建议吗?

python stream tar

8
推荐指数
1
解决办法
1万
查看次数

Drive API请求中未列出任何Google云端硬盘文件

我正在尝试使用桌面应用获取Google云端硬盘中的文件列表.代码如下:

def main(argv):

    storage = Storage('drive.dat')
    credentials = storage.get()

    if credentials is None or credentials.invalid:
        credentials = run(FLOW, storage)

    # Create an httplib2.Http object to handle our HTTP requests and authorize it
    # with our good Credentials.
    http = httplib2.Http()
    http = credentials.authorize(http)

    service = build("drive", "v2", http=http)
    retrieve_all_files(service)
Run Code Online (Sandbox Code Playgroud)

然后在retrieve_all_files中,我打印文件:

param = {}
if page_token:
    param['pageToken'] = page_token
    files = service.files().list(**param).execute()
    print files
Run Code Online (Sandbox Code Playgroud)

但在我对我的帐户进行身份验证后,打印的文件列表中没有任何项目.有没有人有类似的问题或知道解决方案?

python google-drive-api google-api-python-client

5
推荐指数
1
解决办法
1602
查看次数

如何使用python检测应用程序是否正在运行以及MAC OS下是否显示消息框

我正在尝试使用 python 为 Mac OS 上的应用程序编写单元测试。我遇到了一个问题,不知道该怎么做。我希望测试程序通过检查进程来检查应用程序是否正在运行,我还想检查是否显示消息框。另外,希望测试程序能自动点击消息框上的按钮。谁能给我一些建议?

python macos unit-testing

5
推荐指数
1
解决办法
1923
查看次数