개발언어/Python
Python 파일 사이즈 확인
후쮸아빠
2019. 12. 15. 12:45
파이썬 파일 사이즈 확인하는 방법
os.path.getsize()를 사용하여 파일 용량(bytes) 확인 가능
import os
path = '파일 경로'
os.path.getsize(path)
https://docs.python.org/3/library/os.path.html#os.path.getsize
os.path — Common pathname manipulations — Python 3.8.1rc1 documentation
os.path — Common pathname manipulations Source code: Lib/posixpath.py (for POSIX) and Lib/ntpath.py (for Windows NT). This module implements some useful functions on pathnames. To read or write files see open(), and for accessing the filesystem see the os
docs.python.org