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....


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

7 Years
Discussion Span
Last Post by rickyfre

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


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
    wx.Color = wx.Colour

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


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.