IndentationError: unindent does not match any outer indentation level
【problem】
从别处copy过来的python代码经过自己改动后,运行出错
【解决过程】
vim file :set list # cat -A file 也可以

可以看到9-12行的indentaion是TAB,13行是4个空格。
Python语法不支持代码对齐中混用TAB和空格。
vim file :1,$s/\t/ /g # 将TAB换成4个空格
ps: 为了代码风格的统一,最好将TAB替换成4个空格
vim ~/.vimrc
set expandtab
IndentationError: unindent does not match any outer indentation level的更多相关文章
- 空格和TAB键混用错误:IndentationError: unindent does not match any outer indentation level
转自:http://www.crifan.com/python_syntax_error_indentationerror/comment-page-1/ [已解决]Python脚本运行出现语法错误: ...
- Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level(转)
[问题] 一个python脚本,本来都运行好好的,然后写了几行代码,而且也都确保每行都对齐了,但是运行的时候,却出现语法错误: IndentationError: unindent does not ...
- 【Python】脚本运行报错:IndentationError: unindent does not match any outer indentation level
[问题] 一个python脚本,本来都运行好好的,然后写了几行代码,而且也都确保每行都对齐了,但是运行的时候,却出现语法错误: IndentationError: unindent does not ...
- 【亲测有效】Nodepad++/Sublime Text3中Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level解决策略
我在开发游戏的时候,发现一个python脚本,本来都运行好好的,然后写了几行代码,而且也都确保每行都对齐了,但是运行的时候,却出现语法错误: IndentationError: unindent do ...
- 【已解决】Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
转自:http://www.crifan.com/python_syntax_error_indentationerror/comment-page-1/ [问题] 一个python脚本,本来都运行好 ...
- python中出现 IndentationError:unindent does not match any outer indentation level
python中出现IndentationError:unindent does not match any outer indentation level 今天在网上copy的一段代码,代码很简单,每 ...
- IndentationError: unindent does not match any outer indentation level笔记
执行一个Python脚本的时候,报"IndentationError: unindent does not match any outer indentation level" 错 ...
- Notepad++中Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
使用Notepad++编辑python代码运行遇到了这个问题: IndentationError: unindent does not match any outer indentation leve ...
- IndentationError: unindent does not match any outer indentation level解决策略
[亲测有效]Nodepad++/Sublime Text3中Python脚本运行出现语法错误:IndentationError: unindent does not match any outer i ...
随机推荐
- vim插件管理vundle备忘
转自:http://blog.csdn.net/jiaolongdy/article/details/17889787/ http://www.cnblogs.com/xia520pi/archive ...
- WinForm:DataGridViewButtonColumn的使用
1. 添加 DataGridViewButtonColumn DataGridViewButtonColumn dgv_button_col = new DataGridViewButtonColum ...
- spring cron表达式
其他参考资料 http://www.blogjava.net/hao446tian/archive/2012/02/13/369872.html http://blog.sina.com.cn/s/b ...
- IIS+域组策略+hosts:禁止访问指定网站
一.简介 禁止访问网站可以通过多种方式实现,在网络设备上实现大概是性能最好的方式.本文在域服务器上实现该功能,优点是配置简单.可自定义跳转页面,缺点也很明显,遇到熟悉操作系统的用户,修改hosts文件 ...
- Ubuntu PPTP 服务器安装
安装相应的包 sudo apt-get install pptpd 修改配置文件pptpd.conf sudo vim /etc/pptpd.conf 设置对应的VPN网络,localip是服务器的, ...
- 连载《一个程序猿的生命周期》- 44.感谢,我从事了IT相关的工作
感谢博客园一直以来的支持,写连载都是在这里首发,相比较CSDN和开源中国气氛要好的多. 节前,想以此篇文章结束<一个程序猿的生命周期>的<生存>篇,对过10的年做一个了断,准备 ...
- frakti && RunPodSandbox 源码分析
listen = flag.String("listen", "/var/run/frakti.sock", "...") hyperEnd ...
- Caffe 单独测试添加的layer
转载请注明出处,楼燚(yì)航的blog,http://home.cnblogs.com/louyihang-loves-baiyan/ 一般我们在使用Caffe的时候,可能需要根据自己的任务需求添加 ...
- 如何进行安全测试-XSS篇
XSS分为三类:Stored XSS.Reflected XSS.Dom-Base XSS (1)Stored XSS,即存储式跨站攻击,存储式跨站攻击简单来说就是攻击者提交给网站的数据会提交并永久保 ...
- HTML和xhtml,CSS
索引: 初学者入门书籍 高级进阶书籍 W3C官方手册 网站架构 移动平台网站开发 视频资源 开发工具 初学者入门书籍: 中文电子书 深入浅出html pdf中文版 魅丽的网页设计 JAVA WE ...