Install py2exe
> pip install py2exe
실행 스크립트
#execute_test.py print 'HelloWorld'
Setup.py 스크립트
#setup.py from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') options = { "bundle_files": 1, # create singlefile exe "compressed" : 1, # compress the library archive "excludes" : ["w9xpopen.exe"] # we don't need this } setup( options = {'py2exe' : options}, windows = [{'script': "merge_swf_helper.py"}], zipfile = None, )
Cmd 창에서 빌드 명령 실행
> python setup.py install
결과 확인
명령을 실행한 폴더의 dist 디렉토리에 들어가면 생성된 exe 파일을 볼 수 있다.