Recently saw several small partners sent pictures of the download script, yesterday copied a python fragment, preface executed a bit, in the home directory immediately appeared a large number of new folders, similar to this effect:
Ls-t
Ol
XX Home life Photos
XX Squeeze squeeze still have some
XX private Pat
XX Beauty Hips
XX Butt
XX Neighbor Girl
XX a leaf cover
XX Xiu Xxluoti
XX Bead Curtain Jade
This is the home directory , it is not possible to play this way, you need to delete these "auto-generated" folder. Learn about Python file and folder operations by the way.
Sort by time first, manually maintain the Ls.txt document, delete the original file, keep the new directory
LS-T >ls.txt# Delete Redundant folders vim removegirls.py
The contents are as follows:
#!/usr/bin/env python #-*-coding:utf-8-*-import osimport shutilroot = '/home/dpc ' for f in open (' Ls.txt '): Filep Ath = Os.path.join (Root,f.strip (' \ n ')) if Os.path.isdir (filepath): Shutil.rmtree (Filepath,true) Else:print ' Hello '
Saved and executed, and everything resumed as first.
Python Delete folder