File size: 805 Bytes
008bc8c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from glob import glob
from tqdm import tqdm

import shutil
import os


path = "/home/limmireu/λ‹€μš΄λ‘œλ“œ/All"
fileNames = sorted(glob(path+"/*.png"))

fileNum = 0

for fileName in tqdm(fileNames[0: 7000]):

    fileName = os.path.basename(fileName)
    fileName = fileName.split(".")[0]

    if fileNum == 7000:
        break

    if (os.path.isfile(f"/home/limmireu/λ‹€μš΄λ‘œλ“œ/All/{fileName}.png") and 
        os.path.isfile(f"/home/limmireu/λ‹€μš΄λ‘œλ“œ/All/{fileName}.xml")):
        
        shutil.move(f"/home/limmireu/λ‹€μš΄λ‘œλ“œ/All/{fileName}.png", 
                    f"/home/limmireu/λ‹€μš΄λ‘œλ“œ/file/{fileName}.png")

        shutil.move(f"/home/limmireu/λ‹€μš΄λ‘œλ“œ/All/{fileName}.xml", 
                    f"/home/limmireu/λ‹€μš΄λ‘œλ“œ/file/{fileName}.xml")

        fileNum += 2