1
icedx 2014-09-30 12:48:46 +08:00
sudo apt-get install build-essential
sudo apt-get install libsqlite3-dev sudo apt-get install sqlite3 # for the command-line client sudo apt-get install bzip2 libbz2-dev wget http://www.python.org/ftp/python/3.3.5/Python-3.3.5.tar.xz tar xJf ./Python-3.3.5.tar.xz cd ./Python-3.3.5 ./configure --prefix=/opt/python3.3 make && sudo make install mkdir ~/bin ln -s /opt/python3.3/bin/python3.3 ~/bin/py echo 'alias py="/opt/python3.3/bin/python3.3"' >> .bashrc |
3
Tink 2014-09-30 13:22:49 +08:00
Python3 +1
先decode再encode的方法实在是悲摧 |
4
pi1ot 2014-09-30 13:31:41 +08:00
优雅的定义是什么
|
5
fxbird 2014-09-30 14:17:37 +08:00
xml本来就应该统一成utf-8的编码,用gb也太不专业了吧
|
6
wangleineo OP |
7
fghzpqm 2014-09-30 15:18:33 +08:00
所有 Python 问题都可以用 «换 Python 3» 解决?
$ ipython Python 3.4.1 (default, Aug 20 2014, 12:12:32) Type "copyright", "credits" or "license" for more information. In [1]: import xml.etree.ElementTree as ET In [2]: ET.parse('test.xml') --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-2-df5d74dfe4aa> in <module>() ----> 1 ET.parse('test.xml') /Users/fghzpqm/.pyenv/versions/3.4.1/lib/python3.4/xml/etree/ElementTree.py in parse(source, parser) 1185 """ 1186 tree = ElementTree() -> 1187 tree.parse(source, parser) 1188 return tree 1189 /Users/fghzpqm/.pyenv/versions/3.4.1/lib/python3.4/xml/etree/ElementTree.py in parse(self, source, parser) 596 # It can be used to parse the whole source without feeding 597 # it with chunks. --> 598 self._root = parser._parse_whole(source) 599 return self._root 600 while True: ValueError: multi-byte encodings are not supported |
8
fghzpqm 2014-09-30 15:30:42 +08:00 1
|