Converting Unicode to integer

Max M maxm at mxm.dk
Wed Aug 28 02:46:34 EDT 2002


Nikola Plejic wrote:

> def handler(**kw):
>     a = txt.text
>     b = txt2.text
>     a = int(a)
>     b = int(b)
>     lbl.text = a + b


       lbl.text = str(a + b)

Unlike other languages Python does not automatically change the type for 
you. You will grow to appreciate this, as it can lead to some very 
subtle bugs that can be hard to catch later on.

regards Max M




More information about the Python-list mailing list