The following code works great with no issues on my PC.
import boto3
s3 = boto3.client('s3', aws_access_key_id='id', aws_secret_access_key='key')
with open('froms3.json', 'wb') as f:
s3.download_fileobj('totals2', 'totals.json', f)
import json
with open('froms3.json', 'r') as datafile:
data = json.loads(datafile.read())
print(data)
data2 = json.loads(data)
data3 = (data2['HOME TEAM:'])
data4 = (data2['AWAY TEAM:'])
data5 = (data2['GAME POINTS WITH FORMULA:'])
data6 = (list(dict.values(data3)))
data7 = (list(dict.values(data4)))
data8 = (list(dict.values(data5)))
print(data6)
print(data7)
print(data8)
But it doesn't seem to work well when I package with Kivy, I know on PC the request would put that JSON file into the current directory, I am having a hard time understanding how Android handles that? I would think I want this data to go into the app data folder, do I specify that or should it work as written here and there is a local directory on android as well?
Thanks
question from:
https://stackoverflow.com/questions/65928736/using-boto3-to-download-from-s3-where-do-i-store-it-on-android-using-kivy 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…