472,952 Members | 2,519 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 software developers and data experts.

py2exe and wxCalendarCtrl?

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, 318), 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"],
)

Jul 18 '05 #1
2 3297
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.
Jul 18 '05 #2
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.


Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222. In the sample below, commenting out...
1
by: | last post by:
I want a binnary file to my aplicattion, but py2exe don't match the xmll.sax module. the py2exe shows this errors: warning: py2exe:...
0
by: Kathleen Kudzma | last post by:
I'm having a problem with py2exe for Python 2.3. I got fixed the Lookuperror no codec search functions registered: can't find encoding by following the instructions on the py2exe page (added...
8
by: Kathleen Kudzma | last post by:
Does anyone know how to resolve the following problem that I'm getting in Python 2.2 and 2.3? PROBLEM: When I try to create a classReader object I get an exception: "SAXReaderNotAvailable: No...
0
by: Steven Bell | last post by:
I am trying to build an executable from a python script. Using python 2.3, SOAPpy 0.10.3, Py2exe 0.4.2. Build command: python setup.py py2exe -w --includes xml.sax.drivers2.drv_py I get the...
6
by: Luc Saffre | last post by:
Hello, I had a strange problem when freezing (using either py2exe or McMillan installer) a script that imports reportlab (which imports PIL (which imports FixTk))). - Python 2.3.3c (also with...
0
by: David Vaughan | last post by:
py2exe and Pmw problem ---------------------- I was really surprised not to find some faq setting out what to do to get py2exe working for a program using Pmw. I'm haemorrhaging time here, and...
0
by: Larry Bates | last post by:
Jimmy Retzlaff wrote: Everyone, Thanks for all your hard work on py2exe, it is greatly appreciated. -Larry Bates
0
by: Jimmy Retzlaff | last post by:
py2exe 0.6.9 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.