我想使用 google colab 打开我的 google 驱动器中的 json 文件。但有一个错误。
from google.colab import drive
drive.mount('/content/drive')
os.chdir("/content/drive/My Drive/Colab Notebooks")
os.listdir()
['keras.ipynb',
'ItemData.json',
'DropData.json',
'DefaultUserData.json',
'MonsterData.json',
'DungenData.json',
'EquipData.json',
'UserData.json',
'game balancing.ipynb']
肯定有“itemData.json”文件 但是当我尝试打开时...
with open('itemData.json') as json_file:
itemData = json.load(json_file)
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-52-da912edd7528> in <module>()
----> 1 with open('itemData.json') as json_file:
2 itemData = json.load(json_file)
FileNotFoundError: [Errno 2] No such file or directory: 'itemData.json'
有什么问题吗???
最佳答案
尝试提出正确的案例。
'itemData.json'
必须是
'ItemData.json'
关于python - 如何在colab中打开Google Drive中的json文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57840143/