Tab indentions on different platforms?

John Machin sjmachin at lexicon.net
Sun Dec 30 00:13:25 EST 2007


On Dec 30, 3:48 pm, John Nagle <na... at animats.com> wrote:
> Thorsten Kampe wrote:
> > * xkenneth (Fri, 28 Dec 2007 14:51:04 -0800 (PST))
> >> I seem to be having problems with running my python code, written on
> >> a Mac, on Linux and Windows boxes.
>
> > You seem to have problems or you do have problems?
>
> >> It seems like the problem has to do with tab indention,
>
>     It really should be a syntax error in Python to mix
> leading tabs and leading spaces in the same file.  One can argue over
> which to use, but a file with both usually leads to trouble.
>

It can be made to do so:

prompt> python -h
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
[snip]
-t     : issue warnings about inconsistent tab usage (-tt: issue
errors)
[snip]

Further advice to the OP: run python with the -t (or -tt) option and
see what you get.



More information about the Python-list mailing list