0

OK geniuses! I have to use python 2.4 and 2.5 here and my programs ideally work with both versions. This area of code was working in 2.4 and 2.5 versions until replacing my computer. Python did not get ported over so I reloaded with new downloads from the web. (both 2.4 and 2.5 and applicable wx python for each version). Now in order for this code to work in version 2.5 I must change the spelling of Color to Colour...Is there some kind of fix for 2.5 that I can add? (Code also works as is with 2.6 python).
Thanks in advance for your inputs....

ricky

bBlk = wx.Color(  0,  0,  0)
bWht = wx.Color(255,255,255)
bGrn = wx.Color(  0,255,  0)
bYel = wx.Color(255,255,  0)
bRed = wx.Color(255,  0,  0)
bGry = wx.Color(128,128,128)
dRed = wx.Color( 96,  0,  0)
dGrn = wx.Color(  0, 96,  0)

Edited by Nick Evan: Fixed formatting

4
Contributors
4
Replies
6
Views
5 Years
Discussion Span
Last Post by rickyfre
Featured Replies
  • In python 2.6, I have both [code=python] >>> import wx >>> wx.Color <class 'wx._gdi.Colour'> >>> wx.Colour <class 'wx._gdi.Colour'> [/code] You could add a piece of code like [code=python] import wx if hasattr(wx, "Color"): wx.Colour = wx.Color else: wx.Color = wx.Colour [/code] Read More

  • I think it has to do more with the version of wxPython than Python itself. Read More

0

I think Python gets the locale from your computer, so perhaps that changed with the installation. You can try
locale.setlocale() and see if it helps.

Edited by woooee: n/a

1

In python 2.6, I have both

>>> import wx
>>> wx.Color
<class 'wx._gdi.Colour'>
>>> wx.Colour
<class 'wx._gdi.Colour'>

You could add a piece of code like

import wx
if hasattr(wx, "Color"):
    wx.Colour = wx.Color
else:
    wx.Color = wx.Colour
0

Thanks everyone! I found a version wxPython2.8-win32-ansi-2.8.9.1-py25.exe on one of my old computers and loaded it instead of the 2.9.9.1 version I had loaded from the internet. The problem is fixed.

ricky

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.