hytos / minorTools / fileChecker.py @ 91b703af
이력 | 보기 | 이력해설 | 다운로드 (925 Bytes)
1 | cf815388 | esham21 | import os |
---|---|---|---|
2 | |||
3 | pngPath = "E:\Projects\CPChem\drawings"
|
||
4 | pdfPath = os.path.join("E:\Projects\CPChem", "aa") |
||
5 | pngList = os.listdir(pngPath) |
||
6 | pdfList = os.listdir(pdfPath) |
||
7 | |||
8 | for index in range(len(pngList)): |
||
9 | pngList[index] = pngList[index].replace('_Page1.png', '') |
||
10 | for index in range(len(pdfList)): |
||
11 | pdfList[index] = pdfList[index].replace('.pdf', '') |
||
12 | |||
13 | for index in range(len(pngList) - 1, -1, -1): |
||
14 | if pngList[index] in pdfList: |
||
15 | pngList.pop(index) |
||
16 | |||
17 | for png in pngList: |
||
18 | print(png) |
||
19 | |||
20 | print('=======')
|
||
21 | |||
22 | pngList = os.listdir(pngPath) |
||
23 | pdfList = os.listdir(pdfPath) |
||
24 | for index in range(len(pngList)): |
||
25 | pngList[index] = pngList[index].replace('_Page1.png', '') |
||
26 | for index in range(len(pdfList)): |
||
27 | pdfList[index] = pdfList[index].replace('.pdf', '') |
||
28 | |||
29 | for index in range(len(pdfList) - 1, -1, -1): |
||
30 | if pdfList[index] in pngList: |
||
31 | pdfList.pop(index) |
||
32 | |||
33 | for png in pdfList: |
||
34 | print(png) |
||
35 | |||
36 | |||
37 |