如何在jupyter笔记本上使用Pylint或其他linter

2024-06-02 07:35:37 发布

您现在位置:Python中文网/ 问答频道 /正文

有没有可能在一个Jupyter笔记本里面有一个线头?在


Tags: 笔记本jupyter线头
1条回答
网友
1楼 · 发布于 2024-06-02 07:35:37
  1. 是的,这是可能的
  2. 您可以为Jupyter笔记本安装pycodestyle,它类似于pylint。 您可以在Jupyter笔记本外壳内使用以下命令:
# 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

  1. 查看this问题以了解更多详细信息。我的答案是我在链接中提供的问题的简短回答。在
  2. 查看this问题,了解更多类似的问题和解决方案。在

相关问题 更多 >