运行一个py脚本报错:IndentationError: unexpected indent,看了看代码缩进没有问题,上网查了下应该是Tab键与空格混用的原因。

打开编辑器设置显示空格,将空格用Tab代替,再次运行脚本,错误消失。

如何让编辑器显示空格?

我用的编辑器是sublime 3,点击首选项->设置用户-> 将"draw_white_space": "all", 放入配置中即可

python运行提示IndentationError: unexpected indent

相关文章:

  • 2021-11-24
  • 2022-12-23
  • 2021-08-16
  • 2021-08-11
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2021-04-17
猜你喜欢
  • 2021-08-18
  • 2021-05-19
  • 2021-09-01
  • 2021-11-09
  • 2021-12-31
相关资源
相似解决方案