Python Windows File Copy with Wildcard Support
- by Wang Dingwei
I've been doing this all the time:
result = subprocess.call(['copy', '123*.xml', 'out_folder\\.', '/y'])
if result == 0:
do_something()
else:
do_something_else()
Until today I started to look into pywin32 modules, then I saw functions like win32file.CopyFiles(), but then I found it may not support copying files to a directory. Maybe…