【发布时间】:2012-06-17 11:42:06
【问题描述】:
我尝试通过运行命令使用 2to3 工具修改 sintax
python C:\Python32\Tools\scripts\2to3.py neo4j.py
得到输出
当打开 neo4j.py 时,我注意到没有任何改变。下面是应该进行更改(根据输出)的代码块:
try:
import json
except ImportError:
import simplejson as json
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
try:
from . import rest, batch, cypher
except ImportError:
import rest, batch, cypher
except ValueError:
import rest, batch, cypher
import logging
logger = logging.getLogger(__name__)
有谁知道如何正确使用 2to3 工具来将代码移植/更改为 v3.2?
【问题讨论】:
-
py2neo 的新版本 (pypi.python.org/pypi/py2neo) 声称 Python 3 开箱即用。
-
我试过这个版本,但它不起作用
标签: python python-2to3