Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. import os
  2. import glob
  3.  
  4. os.chdir('C:\\Users\\Bakhruz_Agalarov\\Desktop\\files')
  5. files = glob.glob("C:\\Users\\Bakhruz_Agalarov\\Desktop\\files\\*")
  6. if len(files) > 2:
  7. for i in range( 2, len(files) ):
  8. os.remove(files[i])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement