【发布时间】:2017-11-06 22:00:31
【问题描述】:
我正在使用 IntelliJ 在 Python 中制作字典,第二个条目给我一个错误 PEP 8(line too long (155 > 120 characters)。
classic_common = {'Abusive Sergeant': 'ADD ME TO YOUR DECK, YOU MAGGOT!',
**'Acolyte of Pain': "He trained when he was younger to be an acolyte of joy, but things didn't work out like he thought they would",**
如何包装字符串,使其仍能正常工作并看起来可读。
谢谢。
【问题讨论】:
-
您应该首先正确地包装您的字典,以便每个键、值都在自己的行上。那么你在 IntelliJ 中应该做的就是在你想要断行的字符串位置按 Enter 键,它应该为你处理引号和对齐。就像这样 -> imagebin.ca/v/3Ozn3XAXQjJw
标签: python intellij-idea