client.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:gdata-python3 作者: dvska 项目源码 文件源码
def _download_file(self, uri, file_path, **kwargs):
        """Downloads a file to disk from the specified URI.

        Note: to download a file in memory, use the GetContent() method.

        Args:
          uri: str The full URL to download the file from.
          file_path: str The full path to save the file to.
          kwargs: Other parameters to pass to self.get_content().

        Raises:
          gdata.client.RequestError: on error response from server.
        """
        f = open(file_path, 'wb')
        try:
            f.write(self._get_content(uri, **kwargs))
        except gdata.client.RequestError as e:
            f.close()
            raise e
        f.flush()
        f.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号