-1

I want to copy all files named alertmap to a new location with the same name as of its parent folder( or within a new folder named the same as its parent folder).

import glob
for file1 in glob.glob("C:\\Users\\mabrol\\Desktop\\boxing\\*\\AlertMap1.txt"):
    print(file1)

for file2 in glob.glob("C:\\Users\\mabrol\\Desktop\\boxing\\*\\AlertMap1.txt"):
    print(file2)

jalazbe
  • 1,801
  • 3
  • 19
  • 40

1 Answers1

0

I haven't used the library before but in this question they suggest shutil-library. It is also explained how it works and what is propably best to use.

Naming the files with a specific pattern is pretty easy and shouldn't be a big issue here.

Michael Holley
  • 119
  • 1
  • 12