5,6번은 파이썬에서 기본 제공하는 tkinter 라는 UI 모듈과 pyinstaller 라는 exe 로 말아주는 편리한 모듈로 구현
파이썬 tkinter - https://docs.python.org/ko/3/library/tkinter.html
tkinter — Tcl/Tk 파이썬 인터페이스 — Python 3.9.6 문서
tkinter — Tcl/Tk 파이썬 인터페이스 소스 코드: Lib/tkinter/__init__.py tkinter 패키지(《Tk 인터페이스》)는 Tk GUI 툴킷에 대한 표준 파이썬 인터페이스입니다. Tk와 tkinter는 대부분의 유닉스 플랫폼과 윈
docs.python.org
파이썬 pyinstaller - https://www.pyinstaller.org/
PyInstaller Quickstart — PyInstaller bundles Python applications
PyInstaller freezes (packages) Python applications into stand-alone executables, under Windows, GNU/Linux, Mac OS X, FreeBSD, Solaris and AIX. PyInstaller’s main advantages over similar tools are that PyInstaller works with Python 3.5—3.9, it builds sm
www.pyinstaller.org
UI 버튼을 누르면 바로 파일이 생성되는 형태로 구현
쓰는 사람들은 한정되어 있어 따로 팝업등의 UX 구현은 하지 않음
def createSendln():
try:
exec(open(addLine()).read())
tkinter.messagebox.showinfo('Create Result', 'Success :D \n')
except:
return exec
window = Tk()
window.title('Log Mask Creator v.1.0')
window.geometry('300x200+100+100')
window.resizable(False, False)
label1 = Label(window, text=' ')
label1.grid(row=0, column=0)
label1 = Label(window, text='Should have file \n "script.txt" ')
label1.grid(row=1, column=0)
label1 = Label(window, text=' ')
label1.grid(row=2, column=1)
btn1 = Button(window, text='Add a Sendline', command=createSendln) #createSendln
btn1.grid(row=3, column=1, sticky=W+E+N+S) # button size makes resizing via sticky
btn9 = Button(window, text='EXIT', command=exitBox)
btn9.grid(row=9, column=1, sticky=W+E+N+S)
window.mainloop()
|
cs |
pyinstaller는 모듈 설치 후 아래의 명령으로 하나의 파일로 묶어서 *.exe 형태로 말았다
# pyinstaller --onefile --icon=bum.ico executionFile.py
막상 만들어 놓고 나니 윈도우7에서는 python api 관련된 dll 파일 문제로 열리지 않는데 윈도우 업데이트도 지원하지 않는 상황이라 좀 난감해졌다
그중에 다행인건 윈도우10에서는 정상동작하고 있다는것...
'QA Engineering > Tool & Automation' 카테고리의 다른 글
파이썬을 이용한 좌표 출력기 v.0.1 (0) | 2023.08.31 |
---|---|
파이썬 스크립트, 젠킨스로 스케줄링 실행 하기 (0) | 2023.08.30 |
Macro Editor -3탄- (0) | 2021.07.13 |
Macro Editor - 1탄 - (0) | 2021.07.13 |
regular expression / regex 정규식 확인 하기 (0) | 2020.08.31 |