An equivalent of linux 'mv src/*.ext dst/'.
(src, dst, ext)
| 1070 | |
| 1071 | |
| 1072 | def mvfiles(src, dst, ext): |
| 1073 | """An equivalent of linux 'mv src/*.ext dst/'. """ |
| 1074 | names = os.listdir(src) |
| 1075 | if not os.path.exists(dst): |
| 1076 | os.makedirs(dst) |
| 1077 | for name in names: |
| 1078 | path = os.path.join(src, name) |
| 1079 | if os.path.isfile(path) and name.endswith(ext): |
| 1080 | shutil.copy(path, dst) |
| 1081 | |
| 1082 | |
| 1083 | def onerror(func, path, _): |
no test coverage detected