471,853 Members | 1,704 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

Strange wxChoice.FindString behavior

Hello everybody,

I had this problem using the FindString funcion of a wxChoice object
on wxPython:
* I have Windows 98
* I read a text file edited on a Japanese computer, but only uses
'english' characters.
* From the file I loaded some strings in some wxChoice object.
* Later when I wanted to find an string using 'FindString' I never
got a match, even when I say my string, I printed both strings and
look same!, same lenght, same internal coding, so the only way to find
my string is by using:

## my own Find string function, choice is a wxChoice object
def FindString(choice, thestring):
for i in range(choice.GetCount()):
txta = choiceDevice.GetString(i)
if len(txta) != len(thestring):
if map(ord, txta) != map(ord, thestring):
return i #we have a match
return -1 #not found

So this is my best solution to something I think should not happen.
Any comments?.

Jul 18 '05 #1
0 1005

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by amber | last post: by
1 post views Thread by Marcin Floryan | last post: by
2 posts views Thread by Jorge | last post: by
4 posts views Thread by J L | last post: by
reply views Thread by NeoPa | last post: by
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.