Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

colab erase recycle bin drive

# credit to Stack Overflow user in the source link

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)

# all files
for a_file in my_drive.ListFile({'q': "trashed = true"}).GetList():
    print(f'the file "{a_file['title']}", is about to get deleted permanently.')
    a_file.Delete()

# specific file
for a_file in my_drive.ListFile({'q': "title = 'weights-improvement-01-10.5336.hdf5' and trashed=true"}).GetList():
    print(f'the file "{a_file['title']}", is about to get deleted permanently.')    
    a_file.Delete()
Comment

PREVIOUS NEXT
Code Example
Python :: tuples in python 
Python :: apa itu duck typing python 
Python :: python turn list of strings into list of doubles 
Python :: python documentacion comentarios 
Python :: jumpssh execute multiple commands 
Python :: json on desktop python 
Python :: python execute echo to file 
Python :: pandas melt and stack 
Python :: where is memory and register in python python 
Python :: remove uppercase letters python 
Python :: Joint Grid plot in seaborn 
Python :: manipulation 
Python :: fill turtle python 3 
Python :: alignment to numpy array 
Python :: Basic Routing In Python 
Python :: pandas count vvariables of each dtype 
Python :: Function to stop a while loop 
Python :: dataset to list python 
Python :: Adding new nested object using Shallow copy 
Python :: get out of a help screen python 
Python :: print backward number 
Python :: convert set to list python time complexity method 3 
Python :: how to print tic tac toe border on terminal in python 
Python :: mql5 python 
Python :: linear plot 1D vector for x python 
Python :: python file operation 
Python :: tkinter window not responding during progress bar 
Python :: get random bright hex color python 
Python :: reopen closed file python 
Python :: data parsing app python 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =