是否可以在 Jupyter Notebook 中使用 linter?
最佳答案
- 是的,这是可能的
- 您可以为 Jupyter Notebook 安装
pycodestyle
,它类似于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
关于python - 如何将 Pylint 或其他 linters 与 Jupyter 笔记本一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58207645/