You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dir.py 455B

123456789101112131415
  1. import time
  2. import os
  3. from os import listdir
  4. from os.path import isfile, join
  5. from collections import OrderedDict
  6. os.chdir("dir")
  7. while True:
  8. files = [f for f in listdir(os.getcwd()) if isfile(join(os.getcwd(), f))]
  9. filesn = "\n".join(files)
  10. filesn = filesn.replace(".password", "")
  11. filesn = "\n".join(list(OrderedDict.fromkeys(filesn.split("\n"))))
  12. print filesn
  13. time.sleep(0.2)
  14. os.system("clear")