How to break long string lines for PEP8 compliance

2019-04-18 04:03发布

This question already has an answer here:

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条回答
仙女界的扛把子
2楼-- · 2019-04-18 04:33

Using string literal concatenation:

pic_url = ("http://graph.facebook.com/{0}/"
           "picture?width=100&height=100".format(me['id']))
查看更多
登录 后发表回答