google colab How to delete everything in a FTP folder using Python?
Go to solution
Solved by C2dan88,
You first need to get a directory listing of the folder you want to delete use FTP.mlsd() method.
Then loop through the list of files, pass the filename to FTP.delete() method if it is a file or if it is a directory call FTP.rmd() method
Take a look at this stackoverflow topic for solutions
https://stackoverflow.com/questions/10042838/delete-all-files-and-folders-after-connecting-to-ftp
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now