PyCharm(Python3)报错 PEP 8: expected 2 blank lines, found 1

问题描述

相信不少初学者在使用PyCharm写函数的时候,可能会遇到这样的问题:
PyCharm(Python3)报错 PEP 8: expected 2 blank lines, found 1
第11行代码处,on_draw()函数报错,错误显示为:PEP 8: expected 2 blank lines, found 1
意思为:需要两个空行,找到了一个。

解决方案

在写函数之前,先空两行。
PyCharm(Python3)报错 PEP 8: expected 2 blank lines, found 1
修改之后,一切正常。