2010-07-30 4 views
0

.py 파일을 .exe 파일로 변환하려고합니다. 그러나, 나는 이상한 결과를 얻는다.py2exe, 문제

출력 :

usage: module1 [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] 
    or: module1 --help [cmd1 cmd2 ...] 
    or: module1 --help-commands 
    or: module1 cmd --help 

error: no commands supplied 

내 코드 : 나는 .exe 파일을 복구 할 경우이 작업을 수행 또한

from distutils.core import setup 
import py2exe 

setup(console=['newstyledemo.py']) 

? 재배포를 위해 플래시 드라이브에 넣고 싶습니다.

내가 스마트 될 수 Gui2exe을 Useing BTW

+0

.exe 파일은 dist 디렉토리 아래에 있습니다. 또한, 당신은 (콘솔 = [{ 'newstyledemo': 'newstyledemo.py'}] 설치 프로그램을 시도 할 수) – plaes

답변

1

, 윈도우 7에 파이썬 2.6을 실행하는거야, 내가 콘솔과 GUI 모두에 그것을 사용할 수 있습니다.

여기 제가 사용한 스크립트이며 잘 작동했습니다.

from distutils.core import setup 
import py2exe 
import sys 

if len(sys.argv) == 1: 
    sys.argv.append("py2exe") 

setup(options = {"py2exe": {"compressed": 1, "optimize": 2, "ascii": 1, "bundle_files": 3}}, 
     zipfile = None, 

     ## data_files = ['apple.jpg', 'cheese.jpg'], 

     #Your py-file can use windows or console 
     windows = [{"script": 'my.py'}])