+ 2
Python Indentation errors when changing block structure of program
what is the best or easiest way to indentation correct when you want to imbed a preexisting block of code in a try except exception handler??? I have a lot of trouble getting indentation correct when I do this.
2 Answers
+ 1
One option is to use an editor with auto indentation function.
Another will be using some python library like the built in Tabnanny
https://docs.python.org/3/library/tabnanny.html
+ 2
I've found that the code editor in IDLE has block indent and dedent abilitys and solves my problem of moving blocks of code around in python and getting the indentation correct