Advertisement
tymonr

files_to_list.py

Feb 25th, 2020
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. import os
  2. from os import listdir
  3. from sys import argv
  4. import json
  5.  
  6. filesList = filter(lambda x: x.endswith(argv[2]), listdir(argv[1]))
  7. filesDict = { i : { 'path': i } for i in filesList }
  8.  
  9. print(json.dumps(filesDict))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement