tymonr icon

files_to_list.py

tymonr | PRO | 02/25/20 05:09:40 PM UTC | 0 ⭐ | 386 👁️ | Never ⏰ | []
Python |

220 B

|

None

|

0 👍

/

0 👎

import os
from os import listdir
from sys import argv
import json
 
filesList = filter(lambda x: x.endswith(argv[2]), listdir(argv[1]))
filesDict = { i : { 'path': i } for i in filesList }
 
print(json.dumps(filesDict))

Comments