본문 바로가기
Programming/Python

[Python] 경로 안의 파일 리스트 가져오기

by chaloalto 2021. 9. 1.
# -*- coding: utf-8 -*-
import os
path = "./"
file_list = os.listdir(path)
print ("file_list: {}".format(file_list))
file_list: ['testdira', 'eq.js', 'test.db', 'etl.py', '.etl.py.swp', 'testdirb', 'testdirc', 'find_file.py', 'asd.py', 'namespace_.py', 'namespace_2.py', 'eq.py']