분류 전체보기168 24. 디렉토리 관리 프로그램 & 과제 1. 압축파일 정리하기 2. 파일명 정리하기 3. 파일명 변경하기 4. 파일 분류 및 이동하기 ✔ assert 주어진 조건이 True인 확인하고 조건이 False이면 예외를 발생시키는데 사용 주로 디버깅 및 텟트 목적으로 코드에서 사용 디버그 모드에만 동작되며, 배포시에는 작동되지 않음 ※ 과제 위 디렉토리 관리 프로그램을 참고하여 자신의 시나리오를 만들고 파일 관련된 프로그램을 작성해 보자. import os import glob import zipfile import fnmatch import pathlib import shutil target_path = './music_정리전' zipfile_path = [] for filename in glob.glob(os.path.join(target_pat.. 2024. 3. 22. 23. Python File I/O Library 1. OS The os module in Python provides many functions and utilities for interacting with the operating system. This module allows userto perform operations on files, directories, or the operating system itself. 2. glob The glob module provides functions and utilities for interacting with the operating system. This module allows user to perform operations on files, directories, or the operating s.. 2024. 3. 21. 23. 파일 입출력 라이브러리 1. OS 파이썬의 os 모듈은 운영 체제와 상호 작용하는 많은 함수와 유틸리티를 제공합니다. 이 모듈을 사용하면 파일, 디렉터리 또는 운영 체제에 관한 작업을 수행할 수 있습니다. 2. glob 파이썬의 os 모듈은 운영 체제와 상호 작용하는 많은 함수와 유틸리티를 제공합니다. 이 모듈을 사용하면 파일, 디렉터리 또는 운영 체제에 관한 작업을 수행할 수 있습니다. 주요 기능: 와일드카드 문자를 사용한 파일 이름 패턴 매칭 여러 파일 목록 검색 특정 조건에 맞는 파일 찾기 3. fileinput Fileinput 모듈은 파이썬에서 여러 입력 스트림을 동시에 순회하는 데 유용합니다. 이 모듈의 주요 용도는 명령줄에서 명시된 여러 파일을 동시에 읽는 스크립트를 작성하는 것입니다. 주요 기능: 여러 파일을 한.. 2024. 3. 21. 22. Variable type annotation 1. Variable type annotation Python variable type annotations are a feature that allows user to specify the type of data that a variable will store. This can greatly improve the readability of user code and help user catch type errors early in the development process. Improved readability: By specifying the type of a variable, you make it easier for anyone reading your code to understand what kin.. 2024. 3. 21. 이전 1 ··· 28 29 30 31 32 33 34 ··· 42 다음