[유용한함수]디렉토리 만들기, 작업종료 비프음, 작업 걸린 시간측정 함수들

안알랴줌·2023년 1월 31일
0

리마인드용 글쓰기

목록 보기
9/15

디렉토리 만들기

import os

def createDir(directory):
    try:
        if not os.path.exists(directory):
            os.makedirs(directory)
    except OSError:
        print("Error: Failed to create the directory.")

가져온 출처

작업끝남 비프음

import winsound as sd
# 작업 끝남을 알리는 비프음을 내주는 함수
sd.Beep(2000, 1000) #2000=주파수, 1000=시간(1초)

작업 걸린 시간 측정

import time
# 측정하고 싶은 구간의 제일 처음에
%%time
profile
프로그래밍 공부중입니다, 고양이 안키웁니다

0개의 댓글