今天把windows下的python代码传到服务器上,结果莫名其妙的报了一堆indent的错误 网上建议说用: python -m tabnanny filename.py 查一下 然后就用space把有问题的行的tab都换了,程序代码一点没改,就好了 不明白,为甚啊?于是搜了下~ 发现PEP-8上说:Spaces are the preferred indentation method. //PEP is a design document providing information to t
一.查询python安装路径,一般默认是/usr/lib64/ [root@host2 ~]# python Python (r266:, Jul , ::) [GCC (Red Hat -)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>>
我们编译python代码时, 经常出现各种因为tab和空格的问题, 例如: IndentationError: unindent does not match any outer indentation level 有个简便的办法: 用python的IDLE打开python 代码, 选中所有代码, 点击菜单项Format/Untabify Region