python 缩进搞了好久,每次都自己看了没什么问题

IndentationError: unexpected indent

每次都是这个错误。

后来查资料是vimrc配置有点问题

我在写代码的时候用空格代替了tab

python缩进太严格了

真不习惯这种

打开 vim vim/etc/vim/vimrc 命令

找到: set noexpandtab

用  "  注释掉

在: set tabstop=4

前面加上:set expandtab

就可以了

python ndentationError: unexpected indent的更多相关文章

  1. python: indentationerror: unexpected indent

    以后遇到了IndentationError: unexpected indent你就要知道python编译器是在告诉你“Hi,老兄,你的文件里格式不对了,可能是tab和空格没对齐的问题,你需要检查下t ...

  2. IndentationError: unexpected indent python

    都知道python是对格式要求很严格的,写了一些python但是也没发现他严格在哪里,今天遇到了IndentationError: unexpected indent错误我才知道他是多么的严格. 以后 ...

  3. python的IndentationError: unexpected indent python

    都知道python是对格式要求很严格的,写了一些python但是也没发现他严格在哪里,今天遇到了IndentationError: unexpected indent错误我才知道他是多么的严格.    ...

  4. 【python+selenium学习】Python常见错误之:IndentationError: unexpected indent

    初入python+selenium学习之路,总会遇到这样那样的问题.IndentationError: unexpected indent,这个坑我已经踏进数次了,索性记录下来.都知道Python对代 ...

  5. python中遇到的问题:IndentationError: unexpected indent

    在Python中写下列代码的时候,出现错误:IndentationError: unexpected indent 分析:IndentationError是缩进的错误,查看源代码发现names开始的这 ...

  6. Python脚本运行出现语法错误:IndentationError:unexpected indent

    对于py来说典型错误就是缩进,,烦不胜烦,整理一下解决方法:一个python脚本,本来都运行好好的,然后写了几行代码,而且也都确保每行都对齐了,但是运行的时候,却出现语法错误: Indentation ...

  7. [每日一记] Python报错 IndentationError: unexpected indent

    IndentationError: unexpected indent 代码缩进出现错误 今天这个报错的原因是,早些时候的代码里Tab和空格混起来用了,,,[不是我...是编辑器的锅 不过我已经把Su ...

  8. IndentationError: unexpected indent

    都知道python是对格式要求很严格的,写了一些python但是也没发现他严格在哪里,今天遇到了IndentationError: unexpected indent错误我才知道他是多么的严格.    ...

  9. python遇到IndentationError: unexpected indent

    由于tab和空格混用而导致的问题,解决办法如下: 在SubLime中View中的Identation中的Convert Indentitation to Spaces即可

随机推荐

  1. 网络编码 GB2312、GBK与UTF-8的区别

    GB2312.GBK与UTF-8的区别  这是一个异常经典的问题,有无数的新手站长每天都在百度这个问题,而我,作为一个“伪老手”站长,在明白这个这个问题的基础上,有必要详细的解答一下.  首先,我们要 ...

  2. CentOS 6.x 播放 mp3 音乐 —— 成功

    参考:http://blog.chinaunix.net/uid-14735472-id-3472898.html centos 6.x  添加 rpmforge 源--- CentOS 6.x 安装 ...

  3. Android IOS WebRTC 音视频开发总结(十五)-- 培训课程大纲

    最近在给公司做内部培训,主要是关于即时通讯和移动视频通话,包括android与android,ios与ios,android与ios,以及手机与PC. ------------------------ ...

  4. javaSE第十三天

    第十三天    76 1. StringBuffer(掌握)    76 (1)说明:    77 (2)StringBuffer的构造方法    77 (3)StringBuffer的常见功能    ...

  5. Valid Parentheses [LeetCode 20]

    1- 问题描述 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if ...

  6. 必须会的SQL语句(四)删除和更新

    1.删除   1)删除记录   Delete from 表名 where id ='xx'   2)删除所有数据,并回归初始化标识字段.   Truncate table 表名   3)delete与 ...

  7. protobuf的使用

    Protobuf的安装 正确安装方法: [http://blog.csdn.net/guoyilongedu/article/details/17093811] linux下安装protobuf教程+ ...

  8. JqueryMobile动态生成listView并实现刷新的两种方法

    本篇文章主要是对JqueryMobile动态生成listView并实现刷新的两种方法进行了介绍,需要的朋友可以过来参考下,希望对大家有所帮助 JqueryMobile动态生成listView并实现刷新 ...

  9. linux中的audit审计日志

    这里首先介绍auditctl的应用,具体使用指南查看man auditctl.auditctl的man 描述说明这个工具主要是用来控制audit系统行为,获取audit系统状态,添加或者删除audit ...

  10. C#winform初试报表

    步骤1.新建一个窗口,拖一个ReportViewer控件上去,设置该控件的Dock为Fill. 步骤2.添加一个报表文件,如:Report1.rdlc,设置其中的参数,这里设置的参数和下面的代码里面的 ...