https://www.youtube.com/watch?v=v-NpPXEjmRo&t=104s
import os
from os import listdir
from openpyxl import load_workbook, Workbook
files = listdir('B:\python\jupyternotebook\pandas_엑셀투파이썬\파일합치기\예제압축파일')
for file in files:
if os.path.splitext(file)[-1][1:] != "xlsx": # 확장자 추출
continue
print(file)
import pathlib
from os import listdir
files = listdir('B:\python\jupyternotebook\pandas_엑셀투파이썬\파일합치기\예제압축파일')
for file in files:
if pathlib.Path(file).suffix[1:] != "xlsx": # 확장자 추출
continue
print(file)
# pathlib.Path(file).parent
# pathlib.Path(file).name
# pathlib.Path(file).suffix
from os import listdir
files = listdir('B:\python\jupyternotebook\pandas_엑셀투파이썬\파일합치기\예제압축파일')
for file in files:
if file.split(".")[-1] != "xlsx": # 확장자 추출
continue
print(file)
'컴퓨터 > Python' 카테고리의 다른 글
python 열문자를 숫자로 변환, 숫자를 열문자로 (0) | 2023.10.25 |
---|---|
python 암호 걸린 엑셀 파일 불러오기 데이터 형변환 (0) | 2023.10.25 |
python openpyxl 범위 지우기 for 셀단위 None (0) | 2023.10.24 |
python pandas 매입세금계산서 파일 합치기 messagebox 완료 메시지 띄우기 (0) | 2023.10.24 |
pandas 시트 전체 list 파일 전체 합치기, 기존 데이터 지우기 openpyxl delete_rows (0) | 2023.10.23 |