Tab indentions on different platforms?

John Machin sjmachin at lexicon.net
Fri Dec 28 18:13:41 EST 2007


On Dec 29, 9:51 am, xkenneth <xkenn... at gmail.com> wrote:
>     I seem to be having problems with running my python code, written
> on a Mac, on Linux and Windows boxes.

So *what* problems do you seem to be having? More to the the point,
what problems are you *actually* having?

> It seems like the problem has to
> do with tab indention, particularly I've noticed that my code will
> completely ignore try statements. Has anyone had a similar problem?

Yes.

Set up your text editor to (a) recognise Tab and Shift-Tab keyboard
inputs as indent/dedent respectively and (b) to insert 4 spaces and
zero tab characters per indent. IOW, don't have tab characters at all
in your source files.

If after that you still have a problem, ask here again, with the
following information:

1. The shortest possible script file that reproduces the problem --
use
    print open('problemdemo.py', 'rb').read()
to show the contents (a) as it appears on the Mac (b) after
transferring [how?] to Linux (c) after transferring [how?] to Windows

2. The results of executing the code in each of the three environments
-- copy/paste of the actual output, not a description.




More information about the Python-list mailing list