2013-02-28 64 views
0

我“将”一个Python项目从sublime2转移到eclipse。现在我收到了很多缩进错误。我试图给我们reindent.py脚本来纠正这一点,但我得到了一个错误。Python重新加载错误

reindent -r /project_root 

python -m reindent -r /project_root 

结果:

IndentationError: unindent does not match any outer indentation level 

我想递归地再次缩进。

在此先感谢。

+0

如果您正在一个可以轻松安装VIM的系统上运行,Alex Martelli在这个问题上的答案是我已经找到的最快的重新选择替代方法.http://stackoverflow.com/questions/1024435/howto-fix- python-indentation – DeaconDesperado 2013-02-28 19:50:35

回答

0

你可能有一些标签和一些空格,它需要一致。如果你没有很多文件,那么运行python -m tabnanny <file name>.py将有助于解决哪些问题。

+0

与tabnanny相同的事物:缩进错误:unindent不匹配任何外部缩进级别(,第40行) – user937284 2013-03-02 13:37:00