Python finds GIF files in the specified directory

From , 5 Years ago, written in Python, viewed 72 times.
URL https://pastebin.vip/view/3cc69741
  1. #!/usr/bin/python
  2.  
  3. # Use the standard find method to look for GIF files.
  4. import sys, find
  5.  
  6. if len(sys.argv) > 1:
  7.     dirs = sys.argv[1:]
  8. else:
  9.     dirs = [ '.' ]
  10.  
  11. # Go for it.
  12. for dir in dirs:
  13.     files = find.find('*.gif', dir)
  14.     if files:
  15.         print "For", dir + ':'
  16.         for fn in files:
  17.             print " ", fn
  18.     else:
  19.         print "For", dir + ': None'
  20.  
  21. #//python/8022

Reply to "Python finds GIF files in the specified directory"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website