#!/usr/bin/env python
import boto3
import random
import os
BUCKET=os.environ.get('EXPORT_S3_BUCKET_URL')
if (BUCKET != None):
    s3 = boto3.client('s3')
    with open("maze.txt", "rb") as f:
        s3.upload_fileobj(f, BUCKET, "maze"+str(random.randrange(100000))+".txt")
else:
    print("EXPORT_S3_BUCKET_URL was not set so not uploading file")

[(5, 'os.environ.get', 'os.environ.get', False, 'import os\n'), (7, 'boto3.client', 'boto3.client', False, 'import boto3\n'), (9, 'random.randrange', 'random.randrange', False, 'import random\n')]