int(some_string)
returns the integer value of some_string
(if it can be decoded to an integer):Output:>>> type('00012')
<type 'str'>
>>> int('00012')
12
>>> type(int('00012'))
<type 'int'>
What happens when the string is not all digits will be addressed when you come to it.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Your one-stop place for all your GIMP needs: gimp-forum.net