Sep-14-2018, 10:11 AM
(This post was last modified: Sep-14-2018, 10:13 AM by Gribouillis.)
If you copied the file from somewhere else, the original code may contain hard tabs that you cannot see. Supposing the program is named 'myprogram.py', you can do the following
- Close IDLE and open a terminal (or cmd window depending on your OS)
- Type the command
python -m pip install reindent
and press return
- Navigate to the directory/folder containing 'myprogram.py'
- Type the command
reindent myprogram.py
and press return
- Close the terminal and open the file with IDLE again.