[wxPython] want to cPickle bitmaps using img2py encode_bitmaps.py

Please respond to wxpython-users

Hi again,
Sorry, no good.
In the ./Lib/site-packages/wxPython/ directory, I have no Tools dir!
Which RPM is the img2py file in?
Please find below transcript of my efforts.
Also, just dloaded the *new* demo, and it doesnt work. This is possibly due to the images file not finding the file im looking for?

[11:44:25]~/dload/wxPython-2.3.3.1/demo:python2 demo.py
Traceback (most recent call last):
  File "demo.py", line 3, in ?
    import Main
  File "Main.py", line 20, in ?
    import images
  File "images.py", line 4, in ?
    from wxPython.wx import wxImageFromStream, wxBitmapFromImage
ImportError: cannot import name wxImageFromStream

--<snip>--

[11:29:18]/opt/packages/installed:su
Password:
[root@adrastea installed]# rpm -Uvh python2-tools-2.1-5.i386.rpm
Preparing... ########################################### [100%]
package python2-tools-2.1-5 is already installed
[root@adrastea installed]# rpm -Uvh --force python2-tools-2.1-5.i386.rpm
Preparing... ########################################### [100%]
   1:python2-tools ########################################### [100%]
[root@adrastea installed]# rpm -q python2-tools-2.1-5.i386.rpm
package python2-tools-2.1-5.i386.rpm is not installed
[root@adrastea installed]#

[11:25:26]/usr/lib/python2.1:find . -name '*ool*'
./test/output/test_mimetools
./test/test_mimetools.py
./test/test_mimetools.pyc
./test/test_mimetools.pyo
./mimetools.py
./mimetools.pyc
./mimetools.pyo
./site-packages/wxPython/stattool.py
./site-packages/wxPython/stattool.pyc
./site-packages/numarray/_ufuncBool.so
./site-packages/numarray-0.3.6/Src/_ufuncBoolmodule.c
./site-packages/numarray-0.3.6/build/lib.linux-i686-2.1/_ufuncBool.so
./site-packages/numarray-0.3.6/build/temp.linux-i686-2.1/_ufuncBoolmodule.o
./Tools
./Tools/bgen/bgen/scantools.py
./Tools/idle/ToolTip.py
./Tools/webchecker/tktools.py
[11:25:40]/usr/lib/python2.1:cd Tools/
[11:25:47]/usr/lib/python2.1/Tools:ll
total 76
drwxr-xr-x 16 root root 4096 Oct 3 10:31 ./
drwxr-xr-x 14 root root 12288 Jul 22 12:42 ../
drwxr-xr-x 2 root root 4096 Oct 3 10:31 audiopy/
drwxr-xr-x 3 root root 4096 Oct 3 10:31 bgen/
drwxr-xr-x 3 root root 4096 Oct 3 10:31 compiler/
drwxr-xr-x 2 root root 4096 Oct 3 10:31 faqwiz/
drwxr-xr-x 2 root root 4096 Oct 3 10:31 freeze/
drwxr-xr-x 2 root root 4096 Oct 3 10:31 i18n/
drwxr-xr-x 3 root root 4096 Oct 3 10:31 idle/
drwxr-xr-x 3 root root 4096 Oct 3 10:31 modulator/
drwxr-xr-x 3 root root 4096 Oct 3 10:31 pynche/
-rw-r--r-- 1 root root 1046 Sep 26 2000 README
drwxr-xr-x 2 root root 4096 Oct 3 10:31 scripts/
drwxr-xr-x 2 root root 4096 Oct 3 10:31 unicode/
drwxr-xr-x 2 root root 4096 Oct 3 10:31 versioncheck/
drwxr-xr-x 2 root root 4096 Oct 3 10:31 webchecker/
drwxr-xr-x 2 root root 4096 Oct 3 10:31 world/
[11:25:48]/usr/lib/python2.1/Tools:find . -name '*img*'
[11:26:13]/usr/lib/python2.1/Tools:find . -name '*bmp*'
[11:26:18]/usr/lib/python2.1/Tools:find . -name '*encode*'
./scripts/gencodec.py
[11:26:23]/usr/lib/python2.1/Tools:

[11:33:13]/usr/lib/python2.1/site-packages:ll
total 1464
drwxr-xr-x 7 root root 4096 Aug 7 15:31 ./
drwxr-xr-x 14 root root 12288 Jul 22 12:42 ../
drwxrwxr-x 7 root root 4096 Aug 7 15:26 numarray/
drwxrwxr-x 9 root root 4096 Aug 7 15:24 numarray-0.3.6/
-rw-r--r-- 1 beng adpro 710268 Aug 7 12:48 numarray-0.3.6.zip
-rw-rw-r-- 1 root root 9 Aug 7 15:24 numarray.pth
drwxrwxr-x 7 root root 4096 Aug 7 15:20 Numeric/
drwxrwxr-x 9 ianwi 504 4096 Aug 7 15:19 Numeric-21.3/
-rw-r--r-- 1 root root 726057 Aug 7 14:54 Numeric-21.3.tar.gz
-rw-rw-r-- 1 root root 8 Aug 7 15:20 Numeric.pth
-rw-r--r-- 1 root root 119 Jun 8 2001 README
drwxr-xr-x 3 root root 4096 Jul 31 17:27 wxPython/
[11:33:16]/usr/lib/python2.1/site-packages:find . -name '*img*'
[11:33:29]/usr/lib/python2.1/site-packages:find . -name '*bmp*'
[11:33:35]/usr/lib/python2.1/site-packages:find . -name '*g2p*'
[11:33:40]/usr/lib/python2.1/site-packages:

--<snip>--

···

From: "Laszlo Asboth" <laszlo.asboth@yageo.com>
Dear Ben,
It is located in directory Python/Lib/site-packages/wxPython/Tools.
Best regards,
Laszlo

"Ben Gerblich" <benji_75@hotmail.com>
Hi there!
My app loads bitmaps for icons from ./pic/cut.bmp, ./pic/paste.bmp etc.
I want to compress all these bitmaps and store the cPickled data inline in

my app code.

The demo has a file images.py containing:

#----------------------------------------------------------------------
# This file was generated by
C:\projects\wx\wxPython\demo\encode_bitmaps.py
#
from wxPython.wx import wxBitmapFromXPMData, wxImageFromBitmap
import cPickle, zlib
def getMondrianData():
    return cPickle.loads(zlib.decompress(
'x\xda\xd3\xc8)0\xe4\nV76R\x00"3\x05Cu\xae\xc4`u\x05\x85d\x05\xa7\x9c\xc4\
\xe4l0/\x02\xc8Sv\x03\x030?\x1f\xc47\x00\x02(_\x0f"\x0f\x12\x01\xf3\xb5!\xf2\
NnP\xbe?L?\x94\xaf@\x00@\x14\xe9\x81\x81B\x04v0"\x14\x11\x15NP\x1dX\x0c\xc9\
\x07\x82!\xa9\x88(\xdf!\x85\xd3\xa8"\x92\x14a\x01\x98\x8a\xfc\x91\x80\x826\
\x08\x0c\x0bE\x84\xb3\x94\x1e\x00\xbf\x04Z\xed' ))

This is exactly what I want to do.

Looking at the ./demo/encode_bitmaps.py file, it imports img2py. I dont
have
this module:

[17:54:30]~/py/demo/demo:python2 encode_bitmaps.py
Traceback (most recent call last):
  File "encode_bitmaps.py", line 12, in ?
    import img2py
ImportError: No module named img2py
[17:55:06]~/py/demo/demo:

Please help me find this module (img2py), or advise otherwise.
Cheers,
BenG.

_________________________________________________________________
Join the world?s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx

Ben Gerblich wrote:

Please respond to wxpython-users

Hi again,
Sorry, no good.
In the ./Lib/site-packages/wxPython/ directory, I have no Tools dir!
Which RPM is the img2py file in?

wxPythonGTK-py<ver>-2.3.3.1-1.i386.rpm

Please find below transcript of my efforts.
Also, just dloaded the *new* demo, and it doesnt work. This is possibly due to the images file not finding the file im looking for?

[11:44:25]~/dload/wxPython-2.3.3.1/demo:python2 demo.py
Traceback (most recent call last):
File "demo.py", line 3, in ?
   import Main
File "Main.py", line 20, in ?
   import images
File "images.py", line 4, in ?
   from wxPython.wx import wxImageFromStream, wxBitmapFromImage
ImportError: cannot import name wxImageFromStream

Looks to me like you don't have wxPython 2.3.3 but 2.3.2.

···

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