Tag Archives: notepad++

Indenta in Python tionError:unindent does Error

This Po is reproduced: https://blog.csdn.net/u010412719/article/details/47089473
 
Today in the net copy of a piece of code, the code is very simple, every line looks like the indentation of the indentation, run the time appeared the following error:

[solution]
1. The most common reason for this error is that, indeed, there is no indentation. Depending on the number of lines of error, the code looks fine, there are indenting, and there are no syntax errors.
2. After looking through the code and realizing that nothing really went wrong, it occurred to me to display all the characters in the current Python script (including Spaces and TAB characters) to see if there was any indentation or any other special characters.

Notepad++, the current text editor, has a setting to display all characters.
in:
view — > Display symbol – & GT; Show Spaces and tabs
so you can see whether or not our Python code is indented.

Finally, it turns out that the error is actually caused by the fact that the error line appears to be indented, but actually it is not. This is the root of the problem.
I found a problem that none of the Python code I copied was indent, which requires extra attention when We copy other people’s code. Don’t make it look like your code is indented to feel ok, it’s not actually indented.

[turn] right click to open the prompt [shellexecute failed (2): is this command correct? (fix)] with Notepad + +

error:

error: right click on notepad++ to open file

ShellExecute failed (2): Is this command Correct?.

is caused by having notepad++ ‘run as administrator’ option turned on, according to a search engine.

solution :

Find notepad++. Exe, right-click on it, go to the compatibility TAB, uncheck “run this program as administrator”, and finally “apply” and “ok”.

my environment: Windows10, Windows 7 estimation is the same method.

Notepad++ is the default software installation directory for disk C.

solution from: https://notepad-plus-plus.org/community/topic/10945/shellexecute-failed-2-is-this-command-correct-fix

How Notepad + + displays all characters (for hidden carriage return spaces)

notepad++ displays full characters, i.e. the newline symbol CRLF (note: this is in Windows), Spaces’. ‘, etc.

Settings:

Chinese version: view –> show symbol –> show all character

view –> Display symbol –& GT; Display all symbols

display if you do not want to display again and according to the original operation to remove the check.

Windows system after full display

LF means linefeed, newline, \n, ASCII code 10

why can only LF (\n) be used to wrap lines in C language?Because of the presence of the C language to write UNIX operating system, and in the UNIX operating system in LF, for line end, and automatically add the CR, in order to save the length of a byte (do this on the storage capacity is not big computer is really meaningful, and in order to constantly compatible, to now also did not change the rules). In C, the runtime automatically converts LF to CR+LF on display (note the runtime, not the compiler, so even if you open the EXE file and find the corresponding location, only a 0x0A LF is found, and no CR