Add this line at the top of your file to specify the encoding:
# -*- coding: utf-8 -*-
Question
Python doesn't save the file with Hebrew characters. How do I fix this? (Python 2.7)
The example image shows a file in the SPE IDE with a first line of
heb = ["ד" ,"ג" ,"ב", "א", ...]
Solution
Add this line at the top of your file to specify the encoding:
# -*- coding: utf-8 -*-
OTHER TIPS
The editor is trying to save in an encoding that doesn't support the characters you use. Specifying the encoding in the file, with
# -*- coding: utf-8 -*-
And tell SPE to save in UT-F8 (in the settings somewhere).
It's not clear whether the problem is with your IDE or Python.
To get Python to behave properly, you need to declare the source file encoding in the source.