Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import boto
- from os.path import exists
- from sys import exit
- s3_conn = boto.connect_s3()
- key = s3_conn.get_all_buckets()[0].get_all_keys()[0]
- if(exists(key.name)):
- print("The file named %s already exists." % (key.name))
- exit(0)
- key.get_contents_to_filename(key.name)
Add Comment
Please, Sign In to add comment