i have to change default tab length in pydev

C

Coonay

during last few days, i code python using notepad++ or pydev, the
compiler always complain there is a problem with Indentation,in my
eyes ,there is no Indentation problem at all,because i format the code
to make it comply with python style guide strictly,but after i change
the default tab length ,it works.

why is that?
 
D

Dave Angel

Most such problems are caused by mixing tabs and spaces in the same
file. Pick one style and be consistent, and you'll be in good shape.

My approach is to always expand tabs. My tab key simply gets me to a
convenient column, there never are any tabs in my source files.

(I don't use either notepad++ or pydev, but most editors I have used or
written can be configured to use spaces)
 
C

Coonay

If you're mixing tabs and spaces, which from your description you are,
then you aren't complying strictly with the Python style guide.  PEP 8
says:

"""
Tabs or Spaces?

    Never mix tabs and spaces.
"""

Clearly the compiler was considering tabs to be a different width to
your editor's initial setting.  Where you saw:

         Line starting with 8 spaces
         Line starting with a tab

in the editor window, the compiler instead saw:

         Line starting with 8 spaces
     Line starting with a tab

or something like that.  Running with "python -t" will warn you about
this sort of thing.
i understand that you get request token,and you need to get Access
tokens after that,
my question is about Access tokens:which mechanism do u use to tore
access tokens for future use
 
F

Fabio Zadrozny

Most such problems are caused by mixing tabs and spaces in the same file.
 Pick one style and be consistent, and you'll be in good shape.

My approach is to always expand tabs.  My tab key simply gets me to a
convenient column, there never are any tabs in my source files.

(I don't use either notepad++ or pydev, but most editors I have used or
written can be configured to use spaces)

Just as a note, both notepad++ and pydev do support using spaces for tabs.

Cheers,

Fabio
 
C

Coonay

I'm sorry, I have no idea what you're talking about or how it relates
to bad indent levels.  What *exactly* (including the *whole* traceback)
is Python saying to you?
sorry , Rhodri ,i replythe wrong post,As of this my own post,i think
your opnion is reasonable though,but it's still a little wield of
python indentation syntax
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,294
Messages
2,571,510
Members
48,195
Latest member
Tomjerry

Latest Threads

Top