“inconsistent use of tabs and spaces in indentation”

后端 未结 28 2247
北恋
北恋 2020-11-22 00:56

I\'m trying to create an application in Python 3.2 and I use tabs all the time for indentation, but even the editor changes some of them into spaces and then print out \"inc

28条回答
  •  后悔当初
    2020-11-22 01:37

    Your problem is due to your editor limitations/configuration. Some editors provide you of tools to help with the problem by:

    1. Converting tabs into spaces

      For example, if you are using Stani's Python editor you can configure it to do it on saving.

    2. Converting spaces into tabs

    If you are using ActiveState Komodo you have a tool to 'tabify' your code. As others already pointed, this is not a good idea.

    Eclipse's Pydev provides functions "Convert tabs to space-tabs" and "Convert space-tabs to tabs".

提交回复
热议问题