Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

Commit dd40006

Browse files
author
Andrew Fitz Gibbon
committed
Update sample to also fetch the object, and delete the object and bucket.
1 parent 51978bf commit dd40006

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

s3_sample.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,13 @@
3131

3232
print "Uploading some data to " + bucket_name + " with key: " + k.key
3333
k.set_contents_from_string('This is a test of S3. Hello World!')
34+
35+
# Fetch the key to show that we stored something.
36+
print "Downloading the object we just uploaded:\n"
37+
print k.get_contents_as_string() + "\n"
38+
39+
print "Now delete the same object"
40+
k.delete()
41+
42+
print "And finally, delete the bucket."
43+
s3.delete_bucket(bucket_name)

0 commit comments

Comments
 (0)