: 여기
setup(windows=...
나는
example.pyw
라는 이름의 파일에 간단한 wxPython에 응용 프로그램을 가지고 : 당신이 그것을
windows
을 만들 필요가있는 동안
setup(console=...
:
# -*-coding: utf-8 -*-
#!python
# @file: example.pyw
import wx
class AppFrame(wx.Frame):
def __init__(self, title, *args, **kwargs):
super(AppFrame, self).__init__(None, title=title, *args, **kwargs)
self.panel = wx.Panel(self)
class AppMain(wx.App):
def OnInit(self):
self.frame = AppFrame("Example")
self.frame.Show()
return True
AppMain(True).MainLoop()
이것은 sim입니다. 모든 것이 잘 된 경우는 폴더와 dist
이름 뻔
> python setup.py py2exe
running py2exe
creating C:\Users\XXX\build
creating C:\Users\XXX\build\bdist.win32
...
KERNEL32.dll - C:\Windows\system32\KERNEL32.dll
MSVCP90.dll - C:\Program Files\CMake 2.8\bin\MSVCP90.dll
RPCRT4.dll - C:\Windows\system32\RPCRT4.dll
>
:라는 이름의 파일에 PLE 설치 setup.py
:
# -*-coding: utf-8 -*-
#!python
# @file: setup.py
from distutils.core import setup
import py2exe
# http://msdn.microsoft.com/en-us/library/ms648009%28v=vs.85%29.aspx
RT_MANIFEST = 24
# http://en.wikipedia.org/wiki/Side-by-side_assembly
manifest = """
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.VC90.CRT"
version="9.0.21022.8"
processorArchitecture="*"
publicKeyToken="1fc8b3b9a1e18e3b"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
"""
setup(
windows = [{
"script" : "example.pyw",
# "icon_resources" : [(1, "icon.ico")] # have an icon?
"other_resources" : [(RT_MANIFEST, 1, manifest)]
}]
)
는 python setup.py py2exe
을 해당 디렉토리와 같은 디렉토리 및 cd
에 넣어 실행 내부는 example.exe
입니다. 그것을 실행하면 콘솔이없는 창이 표시됩니다.
잘 모르겠지만, wx의 새로운 버전이 SxS 매니페스트를 더 이상 필요로하지 않는다고 생각합니다. 나는 파이썬 2.6과 wx 2.8에서만 생각하고 있었다. –
Sweet !! 매우 감사. 그래도 "other_resources"라인을 주석 처리해야했습니다. 나에게 "SyntaxError : invalid syntax"를 보여 주었다. – user2963623