Automatic indentation for Python in Notepad++

一个人想着一个人 提交于 2019-11-29 02:53:54

This is what you want:

Settings > Preferences > MISC. > Auto-Indent (checkbox)

--

Sometimes people ask, "How can I do x in program y?"

I have a dream that one day "Use program z instead" will not be the most popular response.

Chris

I played a bit with python in Notepad++ and I had a problem with the tab. Since in python your indentation is really important but notepad ++ put space instead of a tab.

So to change to tab you need to go in notepad ++ Menu Settings > Preferences... then select Tab Settings Then select python in the Tab Settings box and uncheck Use default value and check Replace by space.

Like the other answer, you might want to consider another ide. I personally use eclipse with the pydev plugin and django plungin. Erik is nice too.

Derwent

I found the Python Indent plugin on the official plugin page, and it worked fine!

http://docs.notepad-plus-plus.org/index.php/Plugin_Central#P

Well, here is a updated answer:

Notepad++ >> Plugins >> plugin manager >> show plugin manager >> find (python indent) click install >> should be downloaded you need to reach to enable again from Plugins>>python indent>>enable

Go to Settings > Preferences > Language

Then on the "Tab Settings" box select "python" and tick the "Use default value" checkbox.

You're welcome.

P.S. Yeah, I know this a little old. I really just couldn't help it. Anyway, this is for version v7.3.2.

  1. Click on Settings
  2. Click Preferences...
  3. Browse drop-down menu to find MISC.
  4. Tick the box which says Auto-indent

After that, you should be fine.

A better ide might be spyder. http://code.google.com/p/spyderlib/ its about the best IDE I have found.

Geany is a fast and light-weight cross-platform IDE, it supports auto-completion and auto-identation for python code, execute run your program , integrated console , plus has a symbol list side pannel that lets you visualize and browse you code easily, you can jump directly to function definitions and the likes using the context menu, plus it's open source

How ever for a full fledged IDE i would recommand Eric4

I've found Notepad++ to live up to the task of being a better basic text editor than Notepad, but it isn't really designed to be as smart as a proper programming IDE.

It might be possible to get it to do what you're asking for, but I certainly don't know how to set it up that way.

Emacs has python-mode which (also) does it. Grab it and prepare for life-time enjoyment.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!