https://docs.python.org/3/library/os.html#os.walk
os — Miscellaneous operating system interfaces
Source code: Lib/os.py This module provides a portable way of using operating system dependent functionality. If you just want to read or write a file see open(), if you want to manipulate paths, s...
docs.python.org
import os
summary_filelist = []
for path, dir, files in os.walk(".."):
for filename in files:
path_file = path + "/" + filename
summary_filelist.append(path_file)
print(summary_filelist)
현재 폴더를 포함한 하위 폴더들의 모든 파일목록을 리스트에 저장하는 코드
'Python, API' 카테고리의 다른 글
[Python][Bitstamp API] OHLCV 요청 (0) | 2024.06.07 |
---|---|
[Python][Bybit V5 API] Private/Public Websocket 접속 (0) | 2024.05.27 |
[Python] 분봉데이터로 당일의 누적OHLCV 계산하기 (0) | 2023.06.22 |
[Python] Sharp Ratio / Sortino Ratio / Carmar Ratio 계산 (0) | 2023.06.19 |
[Python] 체결데이터로 분봉(OHLCV) 만들기 (0) | 2023.06.04 |