User Tools

Site Tools


software:python

Python

Bypass encoding problems (ascii->utf-8) in python 2.x

  1. Open the python binary with your favorite text editor
  2. Change the first line (usually #!/usr/bin/python) to:
#!/usr/bin/python2.7 -S

import sys
sys.setdefaultencoding("utf-8")
import site
software/python.txt · Last modified: 2013/11/10 16:36 by Michele Porelli