【发布时间】:2021-01-11 18:02:15
【问题描述】:
这是来自测试 python 文件的错误代码:
asdf = "test"
print(asdf)
my_list = [1,2,3,4,5]
# expected on save
my_list = [1, 2, 3, 4, 5]
for num in my_list:
print(num)
# Expected on save (does not format)
# print(num)
# if i manully indent to 2 spaces it gives me this error:
# "Bad indentation. Found 2 spaces, expected 4"
这是我遇到的错误
这是 pip freeze 命令截图:
我不确定为什么会收到这些错误以及为什么它没有格式化。
【问题讨论】:
-
尝试关注pep8 style guideline 获取您的代码
-
还请避免将代码共享为屏幕截图,因为它不会帮助其他人重现您所面临的问题并轻松提供帮助(而是在您的问题中使用正确的格式复制和粘贴代码)。 How do I ask a good question? 和 How to create a Minimal, Reproducible Example.
标签: python-3.x visual-studio-code pylint python-black