Been playing with Pythoncard. This is a wrapper library for wxpython that simplifies using it somewhat. The best feature of it is probably the resource manager that provides a visual GUI editor for dropping controls and assigning properties, vb style. It is clean and stable.
I've written a utility that uses:
- Pythoncard
- Videocapture Video capturing
- Python Imaging Library (PIL) for image manipulation
- Cheetah template library
and it all works together sweetly. The application generates an html report and uses the HtmlWindow control to display it an also print it, complete with graphics.
Problems encountered:
-
The BitmapCanvas component is supposed to support the display of PIL images directly but it did not work for me. I had to hack bitmapcanvas.py as follows:
1 def drawBitmapScaled(self, aBitmap, xy, size, transparency=1): 2 if isinstance(aBitmap, graphic.Bitmap): 3 img = wx.ImageFromBitmap(aBitmap.getBits()) 4 elif isinstance(aBitmap, wx.Bitmap): 5 img = wx.ImageFromBitmap(aBitmap) 6 elif isinstance(aBitmap, wx.Image): 7 img = aBitmap 8 # pcw elif PIL_FOUND and isinstance(aBitmap, Image.Image): 9 elif PIL_FOUND: 10 img = graphic.PILToImage(aBitmap) 11 elif NUMERIC_FOUND and isinstance(aBitmap, ArrayType): 12 img = graphic.numericArrayToImage(aBitmap) 13 else: 14 return
The isinstance call was returningPIL.Image.Imageso the above test was failing. I put a similar change inDrawBitmap -
The HtmlWindow control does not seem to support coloured fonts. The following:
comes out black instead of red. Maybe it doesn't support .CSS.
<span style="color:#ff0000;">Bin It</span>.

