Python finds the file with the specified extension in the directory

From , 2 Years ago, written in Python, viewed 193 times.
URL https://pastebin.vip/view/f84d4651
  1. import os
  2. items = os.listdir(".")
  3.  
  4. newlist = []
  5. for names in items:
  6.     if names.endswith(".txt"):
  7.         newlist.append(names)
  8. print newlist

Reply to "Python finds the file with the specified extension in the directory"

Here you can reply to the paste above

captcha

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