I really like breaking my long strings like... Take this... my_very_long_string = "I have been looking through PEP 8--Style Guide for Python Code. It recommends a maximum line length of 79 characters. What is the preferred way to continue on another line or lines really long print functions of string literals (Python 3)? The only thing that immediately occurs to me is to break up the string literal into multiple parts separated by + and break after the + . This seems to use Python's built-in line continuation of anything between parens. Is this the preferred way to do this?"
And rewrite it like this... my_very_long_string = ('I have been looking through PEP 8--Style Guide for Python Code.' 'It recommends a maximum line length of 79 characters. What is the' 'preferred way to continue on another line or lines really long print' 'functions of string literals (Python 3)? The only thing that' 'immediately occurs to me is to break up the string literal into' 'multiple parts separated by + and break after the + . This seems to' 'use Python\'s built-in line continuation of anything between parens. Is' 'this the preferred way to do this?') On Tue, Apr 30, 2013 at 10:12 PM, boB Stepp <robertvst...@gmail.com> wrote: > I have been looking through PEP 8--Style Guide for Python Code. It > recommends a maximum line length of 79 characters. What is the > preferred way to continue on another line or lines really long print > functions of string literals (Python 3)? The only thing that > immediately occurs to me is to break up the string literal into > multiple parts separated by + and break after the + . This seems to > use Python's built-in line continuation of anything between parens. Is > this the preferred way to do this? > > Thanks! > boB > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor