aws_s3_utility.py 文件源码

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

项目:hierarchical_rl 作者: wulfebw 项目源码 文件源码
def upload_file(self, filename_to_save_as, file_path):
        """
        :description: uploads a single file to an s3 bucket
        """
        # what is this?
        def percent_cb(complete, total):
            sys.stdout.write('.')
            sys.stdout.flush()

        # select the bucket, where input_s3_bucket takes the form 'bsdsdata'
        bucket = self.conn.get_bucket(self.s3_bucket)

        # send the file to the s3 bucket
        key = Key(bucket)
        key.key = filename_to_save_as
        key.set_contents_from_filename(file_path, cb=percent_cb, num_cb=50)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号