반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 파이썬네이버부동산
- Python
- 네이버 로그인 하기
- Selenium 셀렉터잡기
- Uipath 설치방법
- 네이버매물크롤링
- 파이썬 네이버 로그인
- 왕초보 파이썬 실행
- selenium
- 파이썬 가상환경 설치방법
- Uipath 기초
- pywinauto
- UiPath
- 네이버 로그인 영수증 해결
- 파이썬 환경설정
- 네이버부동산크롤링
- uipath 입문
- pywinauto 윈도우
- pywinauto 윈도우제어
- Element is not clickable at point
- pycdas.exe
- venv 설치
- pycdc.exe
- 커머스API
- 가상환경설치
- 날짜 정규식
- 네이버커머스API
- vscode venv 설치
- 네이버 로그인 캡챠해결
- 파이썬 가상환경 설치
Archives
- Today
- Total
콘솔워크
xlsx 파일을 xls로 변환 본문
반응형
import win32com.client as win32
def xlsx_to_xls(source):
if not str(source).find("xlsx") > -1:
return
if not os.path.isfile(source):
return
excel = win32.gencache.EnsureDispatch("Excel.Application")
wb = excel.Workbooks.Open(source)
xls_file = source[:-1]
if os.path.isfile(xls_file):
os.remove(xls_file)
wb.SaveAs(xls_file, FileFormat=56) # FileFormat = 51 is for .xlsx extension
wb.Close() # FileFormat = 56 is for .xls extension
excel.Application.Quit()
os.remove(source)
변환에 사용한 .xlsx 파일은 삭제된다.
반응형
'프로그래밍 > python' 카테고리의 다른 글
[selenium] 크롬 드라이버의 기본 설치 경로 변경 (0) | 2022.10.18 |
---|---|
python apscheduler BackgroundScheduler start specific times (0) | 2022.10.13 |
따옴표 안의 문자열을 추출하는 정규식 (0) | 2022.10.07 |
dataframe contains and operation 여러 조건을 만족하는 데이터 필터링 (0) | 2022.10.05 |
문자열에서 숫자만 가져오는 여러 방법 (0) | 2022.09.29 |