method 1
<!-- lang: python -->
In [18]: str1 = '123'
In [19]: a = int(str1)
In [20]: a
Out[20]: 123
In [21]: type(a)
Out[21]: int
method 2
<!-- lang: python -->
In [22]: str1 = '123'
In [23]: import string
In [24]: a = string.atoi(str1)
In [25]: a
Out[25]: 123
In [26]: type(a)
Out[26]: int