×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
1
Language: Python
Posted by: Cammy And
Added: Jul 23, 2020 9:13 PM
Views: 4482
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]))