- 공유 링크 만들기
- 이메일
- 기타 앱
파이썬 라이브러리 중 pywin32라는 것이 있습니다.
win32 api들을 파이썬에서 쉽게 사용할 수 있도록 해주는 라이브러리입니다.
이 라이브러리를 이용해서 ShellExecute로 인쇄하는 방법은 다음과 같습니다.
(기본 프린터로 인쇄됩니다.)
import win32api
handle = win32api.ShellExecute(0,
'print', path, None,
os.path.dirname(os.path.abspath(path)),
0 # 0 is mean SW_HIDE
)
if handle <= 32: # 에러 발생 시.
print(Error! Can not print (err code: {})'.format(handle))
참고 자료
- http://stackoverflow.com/questions/18025882/how-to-determine-if-win32api-shellexecute-was-successful-using-hinstance
- https://sourceforge.net/projects/pywin32/
댓글
댓글 쓰기