Converting Unicode to integer

Martin v. Loewis martin at v.loewis.de
Mon Sep 2 01:16:39 EDT 2002


"Nikola Plejic" <Nikola.Plejic at pu.CARNet.hr> writes:

> Thanks, but this still doesn't work - I get a result of 55 instead of 10...
> :(
> 
> Any ideas, anyone?

Can you please obtain and report the output of the following statements?

def handler(**kw):
    a = txt.text
    b = txt2.text
    print type(a),repr(a),type(b),repr(b)
    a = int(a)
    b = int(b)
    print type(a),repr(a),type(b),repr(b)
    c = a + b
    print type(c),repr(c)
    c = str(c)
    print type(c),repr(c)
    lbl.text = c

Regards,
Martin



More information about the Python-list mailing list