Tabnanny真有用吗?

编程入门 行业动态 更新时间:2024-10-13 14:27:45
本文介绍了Tabnanny真有用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我看了一下tabnanny来查看 a python源文件。 但是我没找到任何东西,tabnanny 能够通过编译命令找到无法找到的东西 。 或者我错过了什么? 最好的问候, - Franz Steinhaeusler

解决方案

" Franz Steinhaeusler" < FR ***************** @ utanet.at>在消息中写道 news:en ******************************** @ 4ax ...

我看了一下tabnanny来检查一个python源文件。 但我没找到任何东西,tabnanny 能够通过编译命令找到无法找到的东西。 或者我错过了什么? Tabnanny旨在检查缩进 是否有混合标签和空格。具有混合选项卡的文件 和空格_can_编译就好了如果编辑器生成它们的b $ b与编译器一致同意 那些空格的数量一个标签占据。 另一方面,这样的文件很可能会被搞砸几乎无法修复如果有人尝试 在编辑器中编辑它们以不同方式处理标签 来自生成它的那个。 坚持一个或另一个的文件总是 可以正确编辑和编译。 python 建议使用空格,但不是 每个人都同意这个。 大多数现代的Python感知编辑器处理 情况合理,虽然你可能有 来设置参数。 John Roth 最好的问候, - Franz Steinhaeusler

2004年12月20日星期一13:00:39 -0600," John Roth < ne ******** @ jhrothjr>写道:

Tabnanny旨在检查缩进是否混合了制表符和空格。带有混合标签的文件和空格_can_编译就好了如果生成它们的编辑器同意编译器关于标签占用空间的数量。

感谢您的解释。 我试过找到: def a(): - >打印 - > .print 其中point是空格。 tabnanny here抱怨和python编译得很好。 - Franz Steinhaeusler

Franz Steinhaeusler写道:

感谢您的解释。 我尝试了一个找到的: def a(): - > print - > ; .print 其中point是一个空格。 tabnanny在这里抱怨并且python编译得很好。

真的吗?这是一个语法错误(你不能改变缩进nillywilly 在一个块内),而我正在使用的Python肯定会将此标记为错误:

Hi, I looked at tabnanny to check a python source file. But I didn''t find anything, tabnanny is able to find, what couldn''t be found by compile command. Or have I missed something? best regards, -- Franz Steinhaeusler

解决方案

"Franz Steinhaeusler" <fr*****************@utanet.at> wrote in message news:en********************************@4ax...

Hi, I looked at tabnanny to check a python source file. But I didn''t find anything, tabnanny is able to find, what couldn''t be found by compile command. Or have I missed something? Tabnanny is intended to check whether indentation has mixed tabs and spaces. Files with mixed tabs and spaces _can_ compile just fine if the editor that produced them agrees with the compiler about the number of spaces that a tab occupies. On the other hand, such files are quite likely to be messed up almost beyond repair if one tries to edit them in an editor that treats tabs differently from the one that produced it. Files that stick to one or the other can always be edited and compiled properly. The python recommendation is to use spaces, but not everyone agrees with this. Most modern Python-aware editors handle the situation reasonably, although you may have to set parameters. John Roth best regards, -- Franz Steinhaeusler

On Mon, 20 Dec 2004 13:00:39 -0600, "John Roth" <ne********@jhrothjr> wrote:

Tabnanny is intended to check whether indentationhas mixed tabs and spaces. Files with mixed tabsand spaces _can_ compile just fine if the editorthat produced them agrees with the compiler aboutthe number of spaces that a tab occupies.

Thanks for your explanation. I tried an found: def a(): ->print ->.print where point is a space. tabnanny here complains and python compile it just fine. -- Franz Steinhaeusler

Franz Steinhaeusler wrote:

Thanks for your explanation. I tried an found: def a(): ->print ->.print where point is a space. tabnanny here complains and python compile it just fine.

really? that''s a syntax error (you cannot change indentation nillywilly inside a block), and the Python I''m using surely flags this as an error:

更多推荐

Tabnanny真有用吗?

本文发布于:2023-11-07 00:13:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565031.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有用吗   Tabnanny

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!