1) Navigate to the folder with your current version of python. Mine is:
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources
2) View the python application package, as this is the IDLE.
3) You should see a file called Info.plist containing the line-
<?xml version="1.0" encoding="UTF-8"?>
4) Here you can modify the encoding, keep in mind python dose not support all source encoding options.
Just put special comment line at the beginning of the Python file:
1) Navigate to the folder with your current version of python. Mine is: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources 2) View the python application package, as this is the IDLE. 3) You should see a file called
Info.plist
containing the line-<?xml version="1.0" encoding="UTF-8"?>
4) Here you can modify the encoding, keep in mind python dose not support all source encoding options.Python support following default encode type:
If you are using python 2.x, then want to use UTF-8, Please add following code to your python file:
This will override the default encoding type.