Converts a Python string to an int.