Skip to content

Instantly share code, notes, and snippets.

@borismus
Created October 31, 2011 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borismus/1328059 to your computer and use it in GitHub Desktop.
Save borismus/1328059 to your computer and use it in GitHub Desktop.
yup
#!/usr/bin/env python
import boto
AWS_ACCESS_KEY_ID = 'foo'
AWS_SECRET_ACCESS_KEY = 'bar'
bucket_name = 'baz'
conn = boto.connect_s3(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
bucket = conn.create_bucket(bucket_name,
location=boto.s3.connection.Location.DEFAULT)
from boto.s3.key import Key
k = Key(bucket)
k.key = 'path'
k.set_contents_from_string('contents of string')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment