from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials
auth.authenticate_user()
gauth = GoogleAuth()
gauth.credentials = GoogleCredentials.get_application_default()
my_drive = GoogleDrive(gauth)
while True:
for a_file in my_drive.ListFile({'q': "trashed = true"}).GetList():
# print the name of the file being deleted.
print('delete ' + a_file['title'])
# delete the file permanently.
a_file.Delete()
Reference : https://stackoverflow.com/questions/53028607/how-to-remove-the-file-from-trash-in-drive-in-colab
'IT > Python' 카테고리의 다른 글
| 파이썬 base64 디코딩(restapi개발) (0) | 2022.08.17 |
|---|---|
| Error : "Number of classes in y_true not equal to the number of columns in 'y_score'" (0) | 2022.03.14 |
| colab 자동끊김 방지 (0) | 2022.02.09 |
| object-detection-api활용시 주의할점 (0) | 2022.02.09 |
| Precision,Recall, F1(TP,TN,FP,FN)쉽게 이해하기 (0) | 2022.01.27 |