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. 【MySQL】MySQL同步报错-> Last_IO_Error: Got fatal error 1236 from master when reading data from binary log

    这个报错网上搜索了一下,大部分是由于MySQL意外关闭或强制重启造成的binlog文件事务点读取异常造成的主从同步报错 Last_IO_Error: Got fatal error 1236 from ...

  2. ASP.NET的SEO:SEO Hack --- Html注入和Nofollow

    ASP.NET的SEO:目录 黑帽(black hat)SEO主要是指采取"不怎么道德"(暂时就这么形容吧!)的方式进行搜索引擎优化. 1. 注入攻击,包括Sql注入和Html注入 ...

  3. QQ聊天信息提取

    先前在iOS 8.x版时,往往未能顺利取出QQ的聊天信息,即使顺利取出数据库,却发现聊天信息已被加密处理,仅只能得知是与哪些QQ号进行聊天,而未能顺利得知聊天内容. 但这个情况到后来有了变化,以下情境 ...

  4. leetcode 104

    104. Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is ...

  5. leetcode 21

    合并两个有序数列.属于基础的数据结构问题,核心在于对链表的操作. 代码如下: /** * Definition for singly-linked list. * struct ListNode { ...

  6. FTP操作

    using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Net ...

  7. Centos6.5(final)安装gcc和g++,python以及导致问题的解决方法

    安装gcc:yum install gcc  安装g++:yum install gcc-c++ 安装python: centos默认是2.6的版本, 下载python ,我下载的是2.7.10. 1 ...

  8. CentOS 6.4安装AMH面板

    复制以下代码 然后执行 或者下载wget http://amysql.com/file/AMH/3.2/amh.sh; chmod 775 amh.sh; ./amh.sh 2>&1 | ...

  9. c#自定义控件属性面板及选择资源设置

    博客转移到 http://jacean.github.io/ 继续分享编程经验 因为要做流体布局,但两个控件没办法组合,就做自定义控件.这个控件需要一个text设置文本,一个pic设置图片显示,图片通 ...

  10. Js学习笔记一(鼠标事件.....)

    1.encodeURI与decodeURI()转化url为有效的url(能被识别) Url="http://news.baidu.com/p.php?id='测试'&姓名=hkui& ...