Ami*_*dav 7

  1. 对的,这是可能的
  2. 您可以pycodestyle 为 Jupyter Notebook安装类似于pylint. 您可以在 Jupyter Notebook shell 中使用以下命令:
# install
!pip install pycodestyle pycodestyle_magic


# load
%load_ext pycodestyle_magic


# use
%%pycodestyle
def square_of_number(
     num1, num2, num3, 
     num4):
    return num1**2, num2**2, num3*

# Output
2:1: E302 expected 2 blank lines, found 0
3:23: W291 trailing whitespace

Run Code Online (Sandbox Code Playgroud)
  1. 查看问题以了解更多详细信息。我的回答是对我在链接中提供的问题的简短回答。
  2. 查看问题以获取更多类似的短绒和解决方案。


mar*_*lli 7

是的 - 您可以使用nbQA在 Jupyter Notebook 上运行任何标准 Python 代码质量工具

例如:

pip install -U nbqa pylint
nbqa pylint notebook.ipynb
Run Code Online (Sandbox Code Playgroud)

免责声明:我是 nbQA 的作者