Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > py2exe and wxCalendarCtrl?

Reply
Thread Tools

py2exe and wxCalendarCtrl?

 
 
Stefan Behrens
Guest
Posts: n/a
 
      08-09-2003
Hi,

does anybody know how I can get py2exe to work with wxPython's
wxCalendarCtrl?
Currently, I have just a "standard" setup.py, and py2exe gives me a
syntax error.
Do I need to include any special extension and how?
Below is the output I get as well as a small demo app to reproduce the
problem.

I'm using python 2.2.3, wxPython 2.4.0.7, py2exe 0.4.1


TIA

/Stefan.

P.S. Things work fine without the calendar control (but I need it


---error message---

E:\python\test1>f:\win1_expand\python\python.exe setup.py py2exe
running py2exe
running build
running build_scripts
not copying wxApp1.py (up-to-date)
running install_scripts
not copying build\scripts-2.2\wxApp1.py (output up-to-date)
+----------------------------------------------------
| Processing script wxApp1.py with py2exe-0.4.1
+----------------------------------------------------
Searching modules needed to run 'wxApp1.py' on path:
['E:\\python\\test1\\build\\bdist.win32\\winexe\\li b\\win1_expand\\python\\Lib\\
site-packages', '', 'E:\\python\\test1',
'f:\\win1_expand\\python\\DLLs', 'f:\\w
in1_expand\\python\\lib', 'f:\\win1_expand\\python\\lib\\lib-tk',
'f:\\win1_expa
nd\\python', 'f:\\win1_expand\\python\\lib\\site-packages']
Traceback (most recent call last):
File "setup.py", line 7, in ?
scripts = ["wxApp1.py"],
File "f:\win1_expand\python\lib\distutils\core.py", line 138, in setup
dist.run_commands()
File "f:\win1_expand\python\lib\distutils\dist.py", line 902, in
run_commands
self.run_command(cmd)
File "f:\win1_expand\python\lib\distutils\dist.py", line 922, in
run_command
cmd_obj.run()
File "F:\WIN1_E~1\python\Lib\site-packages\py2exe\build_exe.py", line
590, in
run
mf.run_script(script)
File
"F:\WIN1_E~1\python\Lib\site-packages\py2exe\tools\modulefinder.py", line
114, in run_script
self.load_module('__main__', fp, pathname, stuff)
File
"F:\WIN1_E~1\python\Lib\site-packages\py2exe\tools\modulefinder.py", line
282, in load_module
self.scan_code(co, m)
File
"F:\WIN1_E~1\python\Lib\site-packages\py2exe\tools\modulefinder.py", line
339, in scan_code
self._safe_import_hook(name, m, fromlist)
File
"F:\WIN1_E~1\python\Lib\site-packages\py2exe\tools\modulefinder.py", line
297, in _safe_import_hook
self.import_hook(name, caller)
File
"F:\WIN1_E~1\python\Lib\site-packages\py2exe\tools\modulefinder.py", line
126, in import_hook
q, tail = self.find_head_package(parent, name)
File
"F:\WIN1_E~1\python\Lib\site-packages\py2exe\tools\modulefinder.py", line
168, in find_head_package
q = self.import_module(head, qname, parent)
File
"F:\WIN1_E~1\python\Lib\site-packages\py2exe\tools\modulefinder.py", line
252, in import_module
m = self.load_module(fqname, fp, pathname, stuff)
File
"F:\WIN1_E~1\python\Lib\site-packages\py2exe\tools\modulefinder.py", line
267, in load_module
co = compile(fp.read()+'\n', pathname, 'exec')
File "<string>", line 27
self.calend = wxCalendarCtrl(self, -1, pos = (20,25))
^
SyntaxError: invalid syntax


---code--

#Boa:Frame:wxFrame1

from wxPython.wx import *
from wxPython.gizmos import *
from wxPython.calendar import wxCalendarCtrl

def create(parent):
return wxFrame1(parent)

[wxID_WXFRAME1] = map(lambda _init_ctrls: wxNewId(), range(1))

class wxFrame1(wxFrame):
def _init_utils(self):
# generated method, don't edit
pass

def _init_ctrls(self, prnt):
# generated method, don't edit
wxFrame.__init__(self, id=wxID_WXFRAME1, name='', parent=prnt,
pos=wxPoint(285, 31, size=wxSize(721, 394),
style=wxDEFAULT_FRAME_STYLE, title='wxFrame1')
self._init_utils()
self.SetClientSize(wxSize(713, 367))

def __init__(self, parent):
self._init_ctrls(parent)
self.calend = wxCalendarCtrl(self, -1, pos = (20,25))

---setup.py---

from distutils.core import setup
import py2exe

setup(name = 'test1',
version = '0.1',
scripts = ["wxApp1.py"],
)

 
Reply With Quote
 
 
 
 
Miki Tebeka
Guest
Posts: n/a
 
      08-10-2003
Hello Stefan,

> I'm using python 2.2.3, wxPython 2.4.0.7, py2exe 0.4.1

On python 2.3, wxPython 2.4.1.2 and py3exe 0.4.1 it works.

Miki.
 
Reply With Quote
 
 
 
 
Stefan Behrens
Guest
Posts: n/a
 
      08-11-2003
Indeed it does

Thanks!

br/Stefan.

P.S. Sad thing is only that upgrading to python 2.3 broke boa constructor...

Miki Tebeka wrote:
> Hello Stefan,
>
>
>>I'm using python 2.2.3, wxPython 2.4.0.7, py2exe 0.4.1

>
> On python 2.3, wxPython 2.4.1.2 and py3exe 0.4.1 it works.
>
> Miki.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: [Py2exe-users] py2exe 0.6.9 released Chris Spencer Python 3 12-08-2008 05:17 PM
RE: [Py2exe-users] py2exe 0.6.9 released Mark Hammond Python 0 11-17-2008 05:27 AM
about py2exe, I installed it, but can't find py2exe.exe in my computer. python Python 3 05-22-2006 02:08 PM
[py2exe] py2exe and datetime -> No module named datetime F. GEIGER Python 0 08-16-2004 01:13 PM
Re: py2exe and dynamic service installation ? Harald Schneider Python 0 06-24-2003 09:03 AM



Advertisments