Compiling a Cygwin Python that is wxPython compatible ?

Hi,

Has anyone succeeded in compiling a Cygwin Python that is able to do wxPython stuff ?

(I didn’t, and so I’m using the Windows Python under Cygwin. Consequently, I’m having a lot of grief, especially with different OSs path’s divider (’/’ vs. ‘’) and in trying to get my py2exe/gui2exe packed application to work on both Cygwin and Windows.)

Any information on if you succeeded in building such wxPython friendly Python on Cygwin would be appreciated.

Thanks,

Ron.

Resources:

http://www.wxpython.org/BUILD.html#building-on-windows-with-cygwin-mingw32|the

http://mail.python.org/pipermail/python-list/2005-October/346054.html

http://www.mingw.org/node/17

image001.jpg

image003.jpg

···


Ron Barak, System Development Engineer
LSI Technologies Israel Ltd63 Bar Yehuda Road, Nesher
36651
Israel
Tel: (+972) 4 8203454 x1542 Fax: (+972) 4 8203464

Ron.Barak@LSI.com

I’m not saying there should be a capital punishment for stupidity, but why don’t we just take the safety labels off of everything and let the problem solve itself?

Ron,

Hi,
Has anyone succeeded in compiling a Cygwin Python that is able to do wxPython stuff ?
(I didn't, and so I'm using the Windows Python under Cygwin. Consequently, I'm having a lot of grief, especially with different OSs path's divider ('/' vs. '\') and in trying to get my py2exe/gui2exe packed application to work on both Cygwin and Windows.)
Any information on if you succeeded in building such wxPython friendly Python on Cygwin would be appreciated.
Thanks,
Ron.

I've never used Cygwin, but for issues with path dividers I would recommend os.path.join and the other os.path functions.

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org

Barak, Ron wrote:

Hi,
Has anyone succeeded in compiling a Cygwin Python that is able to do wxPython stuff ?
(I didn't, and so I'm using the Windows Python under Cygwin. Consequently, I'm having a lot of grief, especially with different OSs path's divider ('/' vs. '\') and in trying to get my py2exe/gui2exe packed application to work on both Cygwin and Windows.)
Any information on if you succeeded in building such wxPython friendly Python on Cygwin would be appreciated.

I use Windows Python on cygwin. The only hassle that's really bothered me is dealing with slashes in options on the python command line, and other pathname related stuff. Everything else works fine. To help deal with the command line issues I've made a little shell script that translates cyg paths to windows paths, and made an alias that executes Python using this script. Here it is:

···

------------------------------
#!/bin/bash
#
# Function to pre-process first argument (skipping past options) of a command
# with cygpath to translate paths for Windows tools.
#
function wpath {
     typeset -i cmdstart=1
     local cmd=""
     local args=""

     while arg=${*:$cmdstart:1} && [ "${arg:0:1}" == "-" ]; do
         cmdstart=cmdstart+1
     done

     if [ $# -ge $cmdstart ]; then
         cmd=`cygpath -w ${*:$cmdstart:1}`
         args=${*:$((cmdstart+1))}
     fi

     echo ${*:1:$((cmdstart-1))} $cmd $args
}

exec `cygpath -u $1` `wpath ${*:2}`
------------------------------

My alias looks like this:

  alias py='wcmd $TOOLS/python25/python.exe'

And I can use it in #! lines in script files like this:

  #!/c/TOOLS/wcmd python

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!