How can I tell how many objects I’ve stored in an S3 bucket?

Unless I’m missing something, it seems that none of the APIs I’ve looked at will tell you how many objects are in an <S3 bucket>/<folder>. Is there any way to get a count? 32 Answers 32 Using AWS CLI aws s3 ls s3://mybucket/ –recursive | wc -l or aws cloudwatch get-metric-statistics \ –namespace AWS/S3 –metric-name … Read more

How to upload file with python requests?

I’m performing a simple task of uploading a file using Python requests library. I searched Stack Overflow and no one seemed to have the same problem, namely, that the file is not received by the server: import requests url=”http://nesssi.cacr.caltech.edu/cgi-bin/getmulticonedb_release2.cgi/post” files={‘files’: open(‘file.txt’,’rb’)} values={‘upload_file’ : ‘file.txt’ , ‘DB’:’photcat’ , ‘OUT’:’csv’ , ‘SHORT’:’short’} r=requests.post(url,files=files,data=values) I’m filling the value … Read more

How to save a dictionary to a file?

I have problem with changing a dict value and saving the dict to a text file (the format must be same), I only want to change the member_phone field. My text file is the following format: memberID:member_name:member_email:member_phone and I split the text file with: mdict={} for line in file: x=line.split(‘:’) a=x[0] b=x[1] c=x[2] d=x[3] e=b+’:’+c+’:’+d … Read more