bpDev

bopool1222@gmail.com

  • 분류 전체보기 (106)
    • JAVA (27)
      • Android (18)
    • Python (19)
    • SQL (3)
    • JavaScript (2)
    • Background (55)
      • IT (29)
      • Dee (11)
      • Math (5)
      • Memo (10)
    • Work (0)
  • 태그

CALENDAR

«   2025/12   »
일 월 화 수 목 금 토
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
/ /
  • article thumbnail
    폴더 파일 다루기 Python os, shutil, collections...
    2024.02.07

    os.mkdir() : 디렉토리 생성 os.makedirs() : 인자로 받은 경로에 디렉토리 생성 (모든 경로 디렉토리 없으면 생성함) import os if os.path.exists('ex_folder'): print('The folder already exists.') else: os.mkdir('ex_folder') print('The folder has been created.') os.makedirs('ex_folder/20240206') shutil.copy() : 파일 복사 shutil.copytree() : 디렉토리 복사 import shutil shutil.copytree('D:\ex_folder', 'ex_folder') import shutil shutil.copy('ex_fold..

PREV 이전 1 NEXT 다음

+ Recent posts

Powered by Tistory, Designed by wallel and customized by bpDev
Rss Feed

티스토리툴바