Bind raw_input to input in Python 2:
try:
input = raw_input
except NameError:
pass
Now input will return a string in Python 2 as well.
If you're using six to write 2/3 compatible code then six.input() there points to raw_input() in Python 2 and input() in Python 3.