- 6
- 이니스프리
- 조회 수 2264
1 2 3 4 5 6 | import olefile f = olefile.OleFileIO( '파일명.hwp' ) # HWP 파일 열기 encoded_text = f.openstream( 'PrvText' ).read() # PrvText 스트림의 내용 꺼내기 decoded_text = encoded_text.decode( 'UTF-16' ) # 유니코드를 UTF-16으로 디코딩 print (decoded_text) |
참고로 pyhwp라는 모듈도 있는데 이것도 olefile을 디펜던시로 하고 있어요 ^^
작성자
댓글 6
![profile image](/files/member_extra_info/profile_image/640/096/96640.gif?t=1548527149)
olefile 이 한컴에서 제공하는 라이브러리인가요?
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
2020.10.19. 23:11
![profile image](/files/member_extra_info/profile_image/819/059/59819.png?t=1717193427)
그렇지 않다고 알고 있네요 ^^
https://pypi.org/project/olefile/ 여기를 보시면 OLE2 파일을 위한 범용 라이브러리임을 확인할 수 있어요 :)
olefile is a Python package to parse, read and write Microsoft OLE2 files (also called Structured Storage, Compound File Binary Format or Compound Document File Format), such as Microsoft Office 97-2003 documents, vbaProject.bin in MS Office 2007+ files, Image Composer and FlashPix files, Outlook messages, StickyNotes, several Microscopy file formats, McAfee antivirus quarantine files, etc.
+)
참고로 이 모듈을 개발하신 분은 다음과 같습니다 ^^
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
2020.10.20. 21:37
![profile image](/files/member_extra_info/profile_image/640/096/96640.gif?t=1548527149)
한글 파일포맷이라 독자적인 포맷인줄 알았는데 어느정도 한컴에서도 표준에 맞춰 개발을 하였었나보군요?
심지어 공식적으로 지원하지 않는것 같은데 말이에요.
심지어 공식적으로 지원하지 않는것 같은데 말이에요.
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
2020.10.23. 15:28
![profile image](/files/member_extra_info/profile_image/819/059/59819.png?t=1717193427)
오옷! 감사합니다
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
2021.02.08. 11:49
![profile image](/files/member_extra_info/profile_image/819/059/59819.png?t=1717193427)
옙~ 굿밤 되세요! ^-^
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
2021.02.08. 22:19
권한이 없습니다.