Difference between revisions of "Boto3: aws s3 ls"
Jump to navigation
Jump to search
(Created page with "<pre> #!/usr/bin/env python3 import boto3 def aws_s3_ls(): mys3conn = boto3.client("s3") mys3list = mys3conn.list_buckets() print (mys3list) def main (): aws_s3_ls...") |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | import boto3 | + | #!/usr/bin/env python3 |
− | + | ||
− | + | [[import boto3]] | |
− | def aws_s3_ls(): | + | |
− | + | [[def]] aws_s3_ls(): | |
− | + | mys3conn = [[boto3.client]]("s3") | |
− | + | mys3list = mys3conn.[[list_buckets]]() | |
− | + | [[print]] (mys3list) | |
− | def main (): | + | |
− | + | [[def main]] (): | |
− | + | aws_s3_ls() | |
− | if __name__ == "__main__": | + | |
− | + | [[if __name__ == "__main__":]] | |
− | + | main() | |
== See also == | == See also == |
Latest revision as of 13:57, 2 April 2024
#!/usr/bin/env python3 import boto3 def aws_s3_ls(): mys3conn = boto3.client("s3") mys3list = mys3conn.list_buckets() print (mys3list) def main (): aws_s3_ls() if __name__ == "__main__": main()
See also[edit]
Advertising: