Strange results

It's strange:

from wxPython import wx

def test(s):
    print s

test("%d %d %d %%d" % (1, 2, 3))
--> 1 2 3 %d

wx.wxLogMessage("%d %d %d %%d" % (1, 2, 3))
--> 1 2 3 142546208

wx.wxLogMessage("%d %d %d %%%%d" % (1, 2, 3))
--> 1 2 3 %d

Who can interprete this results?

bye
kvp

···

__________
www.newmail.ru -- п╡я│п╣пЁп╢п╟ я┤я┌п╬-я┌п╬ п╫п╬п╡п╬п╣.

kvp@hotmail.ru wrote:

It's strange:

from wxPython import wx

def test(s):
    print s

test("%d %d %d %%d" % (1, 2, 3))
--> 1 2 3 %d

wx.wxLogMessage("%d %d %d %%d" % (1, 2, 3))
--> 1 2 3 142546208

wx.wxLogMessage("%d %d %d %%%%d" % (1, 2, 3))
--> 1 2 3 %d

Who can interprete this results?

wxLogMessage uses vnsprintf internally, so it is doing it's own substitutions on %d.

···

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