py2exe and wxCalendarCtrl?

Discussion in 'Python' started by Stefan Behrens, Aug 9, 2003.

  1. 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\\lib\\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"],
    )
     
    Stefan Behrens, Aug 9, 2003
    #1
    1. Advertising

  2. Stefan Behrens

    Miki Tebeka Guest

    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.
     
    Miki Tebeka, Aug 10, 2003
    #2
    1. Advertising

  3. 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.
     
    Stefan Behrens, Aug 11, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harald Schneider

    Re: py2exe and dynamic service installation ?

    Harald Schneider, Jun 24, 2003, in forum: Python
    Replies:
    0
    Views:
    1,166
    Harald Schneider
    Jun 24, 2003
  2. F. GEIGER
    Replies:
    0
    Views:
    944
    F. GEIGER
    Aug 16, 2004
  3. python
    Replies:
    3
    Views:
    1,864
    Simon Brunning
    May 22, 2006
  4. Chris Spencer

    Re: [Py2exe-users] py2exe 0.6.9 released

    Chris Spencer, Nov 17, 2008, in forum: Python
    Replies:
    3
    Views:
    592
    Pascal
    Dec 8, 2008
  5. Mark Hammond

    RE: [Py2exe-users] py2exe 0.6.9 released

    Mark Hammond, Nov 17, 2008, in forum: Python
    Replies:
    0
    Views:
    471
    Mark Hammond
    Nov 17, 2008
Loading...

Share This Page