Question

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()
Était-ce utile?

La solution

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

Autres conseils

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.

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.

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top