在sublime装了个自动转化代码为PEP8标准的插件。
下面的图是转化后,怎么感觉看着不是很舒服。这样的代码是规范的吗?我还需要继续使用这个插件吗?
还有
output_path = "%s/%s/%s.m4a" % (variables.VIDEO_STORE_PATH, video.id, base_name)
=>
output_path = "%s/%s/%s.m4a" % (variables.VIDEO_STORE_PATH,
video.id, base_name)
是不是有点别扭...
pep8 has related plug-in detection, just use it to check it, and errors will be reported where errors should be reported
It’s very consistent, especially, at a glance, you can tell it’s a line break within the brackets
Installation
pep8
:
Afterpip install --upgrade autopep8
run:
autopep8 --in-place --aggressive --aggressive <filename>
will automatically adjust your code to the
pep8
style, and then you can compare it with your previous style to see if it matches.Compliant. The reason for line breaks is because pep8 stipulates line length, and we generally follow 79 characters or less.
https://www.python.org/dev/pe...