!pip install kaggle
api_token = {"username":"lky190249","key":"8e5bafa71ffe555c3fe75749523743c2"}
import json
import zipfile
import os
with open('/root/.kaggle/kaggle.json', 'w') as file:
    json.dump(api_token, file)
!kaggle datasets download -d iarunava/happy-house-dataset
if not os.path.exists("/content/competitions/happy-house-dataset"):
    os.makedirs("/content/competitions/happy-house-dataset")
os.chdir('/content/competitions/happy-house-dataset')
for file in os.listdir():
    zip_ref = zipfile.ZipFile(file, 'r')
    zip_ref.extractall()
    zip_ref.close()

参考链接:https://gist.github.com/jayspeidell/d10b84b8d3da52df723beacc5b15cb27

相关文章:

  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2021-05-18
  • 2021-07-02
  • 2022-12-23
  • 2021-12-20
猜你喜欢
  • 2022-12-23
  • 2021-07-03
  • 2021-12-18
  • 2021-06-29
  • 2021-06-24
相关资源
相似解决方案