You should define source code encoding, add this to the top of your script:
# -*- coding: utf-8 -*-
The reason why it works differently in console and in the IDE is, likely, because of different default encodings set. You can check it by running:
import sys
print sys.getdefaultencoding()
Also see:
- Why declare unicode by string in python?
- Changing default encoding of Python?
- Correct way to define Python source code encoding