TabError: inconsistent use of tabs and spaces in indentation
这个问题是说用了制表符做了 python 的缩进。

python 的缩进是 4 个空格算一个缩进,如果不是 4 个空格就会有问题。
正确的缩进我们选中是分格的,一共 4 个空格,如果 1 个的话应该就是 tab 制表符了。

我们编写 python 的话可以改变编辑器的 tab 键对应 4 个空格就好了。

[ 文章推荐 ]
Python 地图篇 - 使用 pyecharts 绘制世界地图、中国地图、省级地图、市级地图实例详解

Geany编辑器设置:

如果没有马上生效的话,设置【项目-使用默认缩进】即可;
如果已经有很多缩进是制表符,可以设置【文档-替换制表符为空格】即可;

注: 如果上面的方法设置默认缩进后不生效,可以把这个 用 Tab 键缩进 选项取消试下。

喜欢的点个赞❤吧!

Python 缩进问题-inconsistent use of tabs and spaces in indentation.原因及解决方法相关推荐

  1. Python中出现“TabError: inconsistent use of tabs and spaces in indentation”原因和解决方法

    初学python,很多调试都会出现 "TabError: inconsistent use of tabs and spaces in indentation" 这个错误,看着明显 ...

  2. TabError- inconsistent use of tabs and spaces in indentation 查验及解决方法

    TabError: inconsistent use of tabs and spaces in indentation 查验及解决方法 报错代码 def eccv16(pretrained=True ...

  3. Python中出现“TabError: inconsistent use of tabs and spaces in indentation”问题的解决

    转载请注明出处:http://blog.csdn.net/dongdong9223/article/details/82745068 本文出自[我是干勾鱼的博客] 执行Python代码时,如果出现错误 ...

  4. 成功解决TabError: inconsistent use of tabs and spaces in indentation

    成功解决TabError: inconsistent use of tabs and spaces in indentation 目录 解决问题 解决思路 解决方法 解决问题 TabError: in ...

  5. 【Python】如何解决“TabError: inconsistent use of tabs and spaces in indentation”问题

    python运行代码时,如果出现如下错误: TabError: inconsistent use of tabs and spaces in indentation 很明显,标志是Tab错误,引起这种 ...

  6. sublime text下 Python 问题:TabError: inconsistent use of tabs and spaces in indentation

    File "G:\ST\Python\code.py", line 52while left < right and (nums[left] == nums[left+1]) ...

  7. TabError: inconsistent use of tabs and spaces in indentation

    Python 编译报错: TabError: inconsistent use of tabs and spaces in indentation 编译环境: python3.5  ,操作系统 Win ...

  8. inconsistent use of tabs and spaces in indentation

    原文:https://blog.csdn.net/u011961856/article/details/78043780 pycharm编写python代码时,有时从不同的文件复制代码,粘贴后会出错, ...

  9. 让sublime text显示空格,到底是点还是横杠TabError: inconsistent use of tabs and spaces in indentation

    报错情况:TabError: inconsistent use of tabs and spaces in indentation 分析,因为前面点部分从网上复制的,后面横杠是自己写的,这种混合写法会 ...

最新文章

  1. 为什么TCP的TIME_WAIT状态要保持2MSL?
  2. ​卷积层和分类层,哪个更重要?
  3. 应用ROWDEPENDENCIES行级跟踪,查询oracle表中数据行上最后的DML时间
  4. 软件测试用python一般用来做什么-python软件测试
  5. c#怎么读htm文件_c#怎么读写文件和获取文件的扩展名
  6. 制作iPhone App demo video
  7. LwIP 之五 详解动态内存管理 内存堆(mem.c/h)
  8. Go语言学习教程:xorm表基本操作及高级操作
  9. zzulioj1111: 多个整数的逆序输出(函数专题)
  10. [ES6] 细化ES6之 -- 前端模块化
  11. Openssl 嵌入式arm移植笔记
  12. 通过 YAPI + Python Flask 实现接口自动化测试
  13. [面试] C++ STL(一)—— 向一个vector中添加N个元素,平均的添加的性能是?
  14. 占空比输出程序c语言,怎样利用c语言来实现占空比的设置?(单片机:SPCE061A)
  15. 回顾2018,生活与代码已无法分离
  16. AndroidStudio项目配置第三方libray库
  17. Nginx----web服务器,反向代理服务器
  18. 时间格式24小时制和12小时制
  19. 卫星数据下载地址整理(包含Sentinel、Modis、Landsat等)
  20. 零基础学软件测试基础篇---什么是软件测试

热门文章

  1. 11:数值的整数次方
  2. UAF学习之Adobe reader CVE-2013-3346
  3. dom4j通过xpath查询xml
  4. Android2.3.7源码结构分析
  5. NK.bin和NK.nb0学习
  6. 小李飞刀:刷题第四弹!
  7. 10.4-全栈Java笔记:常用流详解(二)
  8. 金额大小写转换(1)
  9. 本地预览图片html和js例子
  10. 数据结构快速回顾——栈