Skip to content

Instantly share code, notes, and snippets.

@adenot
Created May 29, 2013 05:30
Show Gist options
  • Select an option

  • Save adenot/5668165 to your computer and use it in GitHub Desktop.

Select an option

Save adenot/5668165 to your computer and use it in GitHub Desktop.
Getting a file from S3 and writing to the disk using authentication in python/boto
import sys, getopt
from boto.s3.connection import S3Connection
conn = S3Connection('YOURKEY', 'YOURSIGNATURE')
from boto.s3.key import Key
bucket = conn.get_bucket('proxy-templates')
k = Key(bucket)
k.key = 'web/lighttpd.conf'
k.get_contents_to_filename('lighttpd.conf')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment