개발 이야기/Python
[Python] Py2Exe - Python 스크립트를 Exe로 배포하자 !!
리치윈드 - windFlex
2018. 3. 3. 01:16
반응형
Python 스크립트를 Exe 로 컴파일하여 배포할때,
첨부 py2exe를 설치한다.
(※ exe파일의 안전성을 위해서 확장자를 "ex_" 변경하여 두었다. ==> exe로 재 변경하여 사용할 것)
아래는 스크립트를 컴파일하는 make와 같은 역할을 스크립트 이다.
from distutils.core import setup
import py2exe
options = {
"bundle_files": 1, # create singlefile exe
"compressed" : 1, # compress the library archive
"optimize" : 2, # do optimize
}
setup(
console = ["url_list_check.py"], # py file to create exe
options = {"py2exe" : options},
zipfile = None # append zip-archive to the executable
)
#setup(
# windows = ["url_list_check.py"],
# )
반응형