Platform<=>version conflict or what?
Jorma Paavola
Jorma.Paavola at Elisanet.fi
Tue May 15 10:40:48 PDT 2007
Hi Werner,
Hereby I submit my used GUItest.py and setup.py , which don=B4t 'compile' =
on Win2k (ANSI) the proper .exe-file to run in Win98 =
environement(generates Traceback as sent before).
Could you see any essential reason in my setup.py used or something else =
... ??
Best regards,
Jorma
_______________________________________________________________________
Hi Jorma,
>>
>> If you still have problems I suggest that you create a small sample =
>> application which shows the problem and post it here together with =
>> your setup.py.
> I=B4ll do so after seen your answer first
>>
>> Werner
>
> Thanks & regards,
>
> Jorma
>
Werner
-------------- next part --------------
# -*- coding: cp1252 -*-
# version(Ansi/Unicode) valinta suoraan command-promptista wx.pth:oon
# wxversion.select("ver")komennolla
# -*- coding: cp1252 -*-
#-----------------------------------------------------------
# Hakee Windows version
#
import wx
import gc
import sys
runningPlatform =3D sys.getwindowsversion()
def create(parent):
return Frame1(parent)
[wxID_FRAME1] =3D [wx.NewId() for _init_ctrls in range(1)]
class Frame1(wx.Frame):
def _init_ctrls(self, prnt):
wx.Frame.__init__(self, style=3Dwx.DEFAULT_FRAME_STYLE, name=3D'', =
parent=3Dprnt, title=3D'GUIFrame', pos=3Dwx.Point(-1, -1), id=3DwxID_FRAME1=
, size=3Dwx.Size(-1, -1))
def __init__(self, parent):
self._init_ctrls(parent)
self.MyGcCollect('Test1',3,1)
wx.Sleep(2)
wx.YieldIfNeeded()
self.MyGcCollect('Test2',3,2)
wx.Sleep(2)
wx.YieldIfNeeded()
self.MyGcCollect('Test3',3,3) =
=
def MyGcCollect(self, message=3D'', max=3D0, done=3D0):
if runningPlatform[0] =3D=3D 4: # Testaa onko Windows 9x
if done =3D=3D 1:
self.dlgPro =3D wx.ProgressDialog('Windows 9x - forcing rel=
ease of resources',
message,
max,
None,
wx.PD_AUTO_HIDE | wx.PD_APP=
_MODAL)
self.dlgPro.Update(done, message)
if done =3D=3D max:
self.dlgPro.Destroy()
x =3D gc.collect()
if __name__ =3D=3D '__main__':
app =3D wx.PySimpleApp()
frame =3D create(None)
frame.Show()
app.MainLoop()
-------------- next part --------------
# Py2Exe version 0.6.3 setup file for console/windows programs.
#
# If this is a windows GUI application replace the last line with
# console/windows =3D [{"script": 'myFile.py'}] )
#
# Enter the file name of your own .py code file in the last line, lets say =
it's test1.py
# so the last line should be: console =3D [{"script": 'test1.py'}] )
# then save this program as p2e_test1.py to the same directory where you=
r code file is located
# Now run p2e_test1.py ...
#
# Two subfolders will be created, called build and dist.
# The dist folder contains your .exe file, MSVCR71.dll and w9xpopen.exe (ne=
eded for os.popen() only)
# Your .exe file contains your byte code, all needed modules and the Python=
interpreter.
# The MSVCR71.dll can be distributed, but is often already in the system32 =
folder.
# The build folder can be deleted.
# tested with Python24 and Py2Exe v0.6.3 by vegaseat 27may2006
from distutils.core import setup
import py2exe
import sys
# no arguments
if len(sys.argv) =3D=3D 1:
sys.argv.append("py2exe")
# creates a standalone .exe file, no zip files
setup( options =3D {"py2exe": {"compressed": 1, "optimize": 2, "ascii": 1, =
"bundle_files": 1}},
zipfile =3D None,
# replace myFile.py with your own code filename here ...
windows =3D [{"script": 'GUItest.py'}] )
More information about the wxpython-users
mailing list