TreeControll und Codierung
Verfasst: Dienstag 20. November 2007, 17:07
Hi,
ich hab ein Problem mit folgendem Code:
Die Fehlermedung ist folgende:
Wo das Problem ist, ist klar.
In welcher Codierung gekomm ich mein ItemText zurück ?
jeroen
ich hab ein Problem mit folgendem Code:
Code: Alles auswählen
# -*- coding: UTF-8 -*-
import wx
import os
class Anwendung(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, '')
panel = wx.Panel(self, -1)
self.tree = wx.TreeCtrl(panel, -1)
self.text = wx.TextCtrl(panel, -1, '', pos=(0,100))
button = wx.Button(panel, -1, '', pos=(0,120))
self.tree.AddRoot('hallö')
self.Bind(wx.EVT_BUTTON, self.Klick, button)
def Klick(self, event):
text = self.tree.GetItemText(self.tree.GetSelection());
self.text.SetLabel(text)
if text == 'hallö':
wx.MessageBox('OK')
else:
wx.MessageBox('Not OK')
if __name__ == '__main__':
app = wx.PySimpleApp()
Anwendung().Show()
app.MainLoop()
Code: Alles auswählen
D:\HSNR\ias\Praktikum2\test.py:22: UnicodeWarning: Unicode equal comparison fail
ed to convert both arguments to Unicode - interpreting them as being unequal
if text == 'hall├Â':
In welcher Codierung gekomm ich mein ItemText zurück ?
jeroen