[python] TypeError: 'str' object cannot be interpreted as an integer