我是一名有用的助手,可以为您翻译文本。
我正在阅读PEP8和Stack Overflow上的一些问题,但我想知道注释之间的空格:
假设我有这段代码:
我正在阅读PEP8和Stack Overflow上的一些问题,但我想知道注释之间的空格:
假设我有这段代码:
class MyBrowser(QWebPage):
''' Settings for the browser.'''
def __init__(self):
QWebPage.__init__(self)
# Specifies whether images are automatically loaded in web pages.
self.settings().setAttribute(QWebSettings.AutoLoadImages, True)
def userAgentForUrl(self, url):
''' Returns a User Agent that will be seen by the website. '''
return "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.15 (KHTML, like Gecko) Chrome/24.0.1295.0 Safari/537.15"
在注释和实际代码之间添加空行的最Pythonic方式是什么?我想向一些专家展示我的程序,并希望我的代码看起来更加专业。