Community
    • 登入

    I want to enter tab characters into my python code, at the start of lines, ideally by pressing the tab key

    已排程 已置頂 已鎖定 已移動 General Discussion
    4 貼文 2 Posters 942 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Ralph CramdenR
      Ralph Cramden
      最後由 Ralph Cramden 編輯

      Try to search on the web for how to NOT have Notepad++ convert tab to spaces. There are only results for the other way around, people who want tabs converted to spaces. Is there any way, for example, when I enter a new line and press tab twice, I will get two tabs instead of all space characters?

      1 條回覆 最後回覆 回覆 引用 0
      • Ralph CramdenR
        Ralph Cramden
        最後由 編輯

        I found out that any file not named *.py is immune from this problem. So I can copy myprog.py to myprog.bak, edit it and then copy it back. But that is unwieldy. Also, I apologize in advance for being the only person in the world that likes indenting with tabs. I have never had any problem doing it this way, and no one has ever explained to me why it is a taboo. I can compose a script anywhere on any text editor and it always works perfectly, except for Notepad++

        1 條回覆 最後回覆 回覆 引用 0
        • Alan KilbornA
          Alan Kilborn
          最後由 編輯

          You can change globally here, or just for Python files:

          acf0d8aa-b9df-48ee-8950-50f7e49b1145-image.png

          Ralph CramdenR 1 條回覆 最後回覆 回覆 引用 2
          • Ralph CramdenR
            Ralph Cramden @Alan Kilborn
            最後由 編輯

            @Alan-Kilborn SOLVED! I realized that I had to select Python in the drop down box, not leave it at [Default]. Thanks very much!

            1 條回覆 最後回覆 回覆 引用 3
            • 第一個貼文
              最後的貼文
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors