User Tools

Site Tools


software:python

This is an old revision of the document!


Phython

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.1384096474.txt · Last modified: 2013/11/10 16:14 by Michele Porelli