Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Cammy And
Added: Jul 23, 2020 9:13 PM
Views: 97
Tags: no tags
  1. import os, re
  2. filelist = []
  3. for root, dirs, files in os.walk('path'):
  4.     for name in files:
  5.         filelist.append('/'.join(re.split('/|\\\\', root) + [name]))