I'm using int(myString), myString = "-1" and I get error:
ValueError: invalid literal for int() with base 10: '"-1"'
The string contains quotes, i.e.
s = '"-1"'
You need to get rid of the quotes, something like
s = '"-1"'
int(s.replace('"', ''))
should do the trick.
str.strip method accepts characters. You can use it to get rid of surrounding quotes:
>>> int('"-1"'.strip('"'))
-1
>>>
int("-1")with no problem. Looks like your number is double quoted. Was able to reproduce it byint('"-1"')myStringafter theconversion? Can you post all you code?