Is there a way around coding in Python without the tab, indent & whitespace criteria?

前端 未结 29 1108
小鲜肉
小鲜肉 2020-12-31 14:05

I want to start using Python for small projects but the fact that a misplaced tab or indent can throw a compile error is really getting on my nerves. Is there some type of s

29条回答
  •  长情又很酷
    2020-12-31 14:41

    It's possible to write a pre-processor which takes randomly-indented code with pseudo-python keywords like "endif" and "endwhile" and properly indents things. I had to do this when using python as an "ASP-like" language, because the whole notion of "indentation" gets a bit fuzzy in such an environment.

    Of course, even with such a thing you really ought to indent sanely, at which point the conveter becomes superfluous.

提交回复
热议问题