Advertisement
Guest User

scriptfolder

a guest
Jun 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import os,time,re
  2.  
  3.  
  4. def list_content(folder):
  5. """list the folder content"""
  6. with open ('info.txt','w') as fh:
  7. for r,d,f in os.walk(folder):
  8. for j in f:
  9. #if f not in l:
  10. for i in re.findall('png',j):
  11. name = time.ctime(os.path.getmtime(os.path.join(r,j)))
  12. fh.write(str(name)+" "+j+'\r\n')
  13.  
  14.  
  15. if __name__ == "__main__":
  16. list_content(os.getcwd(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement