# Let Python Shell do the indentation correctly.

Hi,

Currently, the Python Shell can't indent codes input there correctly. Could you please add this feature for wing?

Regards, HY

edit retag close merge delete

Could you give us an example of what isn't working for you?

( 2020-09-23 08:17:26 -0500 )edit

Example:

for i in range(5):
print(i)


Result:

Traceback (most recent call last):
Python Shell, prompt 1, line 2
builtins.IndentationError: expected an indented block (2, line 2)

( 2020-09-23 18:09:00 -0500 )edit

This seems to work for me. I may be confused due to the messed up formatting your comment had due to the slightly braindead options in this forum. I tried to fix that by editing it; I thought at first maybe 'print(i)' was not indented but it seemed to be. If it were not indented, this is not really something we can fix since moving relative indents within a pasted block has cases where there's ambiguity. However, we do re-indent pasted blocks of code in the shells so it removes any leading indent before all the lines. The bottom line is we may need further clarification on this one.

( 2020-10-05 10:05:19 -0500 )edit