大头
Table_bottom

标签云
Table_bottom

分类
Table_bottom

日历
二月
28293031123
45678910
11121314151617
18192021222324
252627282912
Table_bottom

评论
Table_bottom

留言
Table_bottom

微博
Table_bottom

热门文章
Table_bottom

随机文章
Table_bottom

豆瓣上谁关注这里
Table_bottom

链接
Table_bottom

搜索栏
Table_bottom

RSS
RSS Link
Table_bottom

功能
Table_bottom

页面
Table_bottom

计数器
464585
Table_bottom

访客统计
Table_bottom

存档
Table_bottom

Boto Config File

loveisbug posted @ 2014年5月30日 16:32 in 工作 with tags AWS S3 Boto Python , 2418 阅读

BotoAWS SDK for Python,可以通过pip安装,也可以下载源码直接安装。直接安装挺方便的。

安装后参照AWS给出的Sample Project,连接S3,遍历一下buckets,获取指定的bucket,都挺简单的。

但是忘记了做一件事,没有“export access keys to environment variables”。模仿Sample只能把access key ID和secret access key作为参数写在代码里。

回过头看文档,再找到Boto Config的文档,然后就傻乎乎地试图去找到文档里提到的"boto.cfg"和".boto",折腾半天没找到。

浪费不少时间之后才明白,boto installer是不会自动创建这个config文件的。手动创建一个,放到该放的地方就可以了。

哪些地方是该放的地方呢?Unix/Linux系统里,boto按照这个顺序寻找config文件。

  • /etc/boto.cfg - for site-wide settings that all users on this machine will use
  • ~/.boto - for user-specific settings
  • ~/.aws/credentials - for credentials shared between SDKs

当然,这也不是必须的,可以把config文件放到任何地方,然后在环境变量里配置BOTO_CONFIG。如果是Windows系统咋办?Stackoverflow上这个问题的回答可行。

  • Create your file with the name you want(e.g boto_config.cfg) and place it in a location of your choice
  • Create an environment variable with the Name='BOTO_CONFIG' and Value= file_location/file_name
  • Boto is now ready to work with credentials automatically configured!

当然,最权威的是仔细看Boto Config文档,这里也介绍了在config文件里如何配置Credentials。

 

CBSE fa 3 Question P 说:
2022年9月13日 12:44

Students can download a sample practise question bank with suggested answers for all languages and disciplines for the Formative Assessment-3 Examination, also known as Unit Test-3. Downloading the CBSE STD-1 FA-3 Model Paper 2023 Pdf is open to all students. FA-3 Exam is administered at the start of Session 2 or Term 2. CBSE fa 3 Question Paper Class 1 The Formative Assessment-2 was created and recommended by subject specialists from the board and other top educational institutions for board students in both mediums.

civaget 说:
2024年1月18日 01:28

펀초이스: Your portal to discovering top-rated massage businesses. Real reviews, real relaxation.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter