Created
April 8, 2010 21:04
-
-
Save driedtoast/360538 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
bucketname = 'testbucket' | |
keyname = 'testkey' | |
conn = S3Connection() | |
bucket = None | |
## get bucket or create it | |
try: | |
bucket = conn.get_bucket(bucketname) | |
except Exception, e: | |
bucket = conn.create_bucket(bucketname) | |
## just use key name to delete | |
bucket.delete_key(keyname) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment