user2925800
user2925800

Reputation: 103

Python indentation on notepad++

Every time I write a function in notepad++ it won't indent for me even when I'm pretty sure I have auto-indent selected. I then manually do 4 spaces and do two print commands but it's not working. It says 'unexpected indent' in Powershell. Here's what I'm using:

def print_twice():
    print "hi"
    print "hi"

print_twice()

Upvotes: 0

Views: 3597

Answers (4)

Vizag
Vizag

Reputation: 395

Just in case if you dont see 'tab settings' Under "Preferences", as myself, then you just need to look for.

Notepad++ > Settings > Preferences > language > Tab settings

Upvotes: 0

Samuel Nyong'a
Samuel Nyong'a

Reputation: 7

In Notepad++, Go to Settings>>Preferences. In the dialog box that will appear select Tab Settings, check the 'Replace by space' checkbox. You can alter the number of spaces by clicking on the Tab space: 4 link (whereby the existing tab space is 4 spaces). Close the dialog box. That is it.

Upvotes: 0

Shreyk
Shreyk

Reputation: 1

On your notepad++, go to Settings> Preferences > Tab Settings and Check "replace by space" making sure "tab Size" is set to 4. This has worked for me.

Upvotes: 0

Peter Petrik
Peter Petrik

Reputation: 10165

You can set your notepad++ to always convert tabs to whitespace, or to show whitespace characters. Please see answers in this question

Upvotes: 2

Related Questions