| Store | Cart

How to get TabError?

From: Fredrik Lundh <fred...@pythonware.com>
Sun, 27 Mar 2005 18:34:03 +0200
"Mr. Magoo" wrote:

> Can someone provide a snippet which, when run, generates a TabError?>> I can only seem to get SyntaxError and IndentationError.

$ python -c "print repr(open('test.py').read())"
'if 1:\n\tprint "hello"\n        print "goodbye"\n'

$ python test.py
hello
goodbye

$ python -t test.py
test.py: inconsistent use of tabs and spaces in indentation
hello
goodbye

$ python -tt test.py
  File "test.py", line 3
    print "goodbye"
                  ^
TabError: inconsistent use of tabs and spaces in indentation

</F> 

Recent Messages in this Thread
Mr. Magoo Mar 27, 2005 03:39 pm
Jeff Epler Mar 27, 2005 04:26 pm
Fredrik Lundh Mar 27, 2005 04:34 pm
Mr. Magoo Mar 27, 2005 05:29 pm
Mr. Magoo Mar 27, 2005 05:31 pm
Messages in this thread