问题
I have many long lines like this in the project and don't know how to break it to keep PEP8 happy.
PEP8 shows warning from .format(me['id'])
pic_url = "http://graph.facebook.com/{0}/picture?width=100&height=100".format(me['id'])
How can I break the line to get rid of PEP8 warning and yet don't break the code?
回答1:
Using string literal concatenation:
pic_url = ("http://graph.facebook.com/{0}/"
"picture?width=100&height=100".format(me['id']))
来源:https://stackoverflow.com/questions/25949525/how-to-break-long-string-lines-for-pep8-compliance