In C# we can create regions by using
#region // some methods #endregion
Is there any way to format python code in similar fashion so that I can keep all my relevant methods in one block?
Looks like PyCharm has it, see here: https://www.jetbrains.com/help/pycharm/2016.1/code-folding.html#using_folding_comments
For Python files, the following two styles are supported. You should not mix both of them in a single file.
#<editor-fold desc="Description"> ... #</editor-fold>
or
#region Description ... #endregion
Visual Studio accepts "region" too
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With