- 0. 만들었다.
닌텐도 스위치 앨범 확인 시 년도/월별/일별로 나뉘어서 사진이 저장되어 있어 확인이 굉장히 불편했음.
월별 폴더에 모아놓고 일별 폴더는 지우도록 코드를 구현했다.
import os
import shutil
allpath = 'C:\\BIN\닌텐도'
years = os.listdir(allpath)#years
for i in years:
ypath = allpath + '\\' + i #i year
year = os.listdir(ypath)
for j in year:
mpath = ypath+'\\'+j #j month
#os.chdir(mpath)
month = os.listdir(mpath)
for k in month:
dpath = mpath+'\\' + k #k day
if os.path.isdir(dpath):
os.chdir(dpath)
day = os.listdir(dpath)
for l in day:
shutil.move(dpath+'\\'+l, mpath+'\\'+l)
os.chdir(mpath)
os.rmdir(dpath)
닌텐도 폴더 위치만 변경해 주면 됨.
잘 옮겨지는것을 확인했다.
- 1. 참고 사이트
'Computer' 카테고리의 다른 글
Burf Suite 사용 방법_Intruder를 이용한 Request 수정 (0) | 2023.05.26 |
---|---|
CTF용 Dockerfile 만들기 (0) | 2023.05.26 |
Shellcode 작성, 테스트 (0) | 2022.12.12 |
[Python] Ubuntu 16.04에서 Python 3.5.3 설치하기 (0) | 2019.12.16 |
[Git] GitLab에 프로젝트 추가하기 (0) | 2019.09.17 |