How can I automatically wrap long lines of python so that they print correctly?
In particular, I am trying to add help lines with optparse that I want to easily modify.
I found several methods for working with long strings, none of which allow me to replenish after making changes using Mq in emacs or similar:
p.add_option('-a', help = "this is my\ long help text")
forces new lines in results and does not allow to fill
p.add_option('-a', help = "this is my " "long help text")
but does not allow reloading
p.add_option('-a', help = ''' this is my long help text ''')
wrong but allows recharge
p.add_option('-a', help = dedent(''' this is my long help text '''))
- the best option I found, the formats are almost correct and allows you to refuel, but leads to additional space at the beginning of the line.
source share