IndentationError: unexpected indent
Python 中强制缩进,, IndentationError: unexpected indent 缩进错误
这类错误非常常见,一般都是由于tab在不同的平台上占用长度不同导致,有些事程序员自己直接使用空格或其他来顶替tab。
解决办法非常简单,在所在平台上使用标准的tab进行缩进,就OK了。
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 106: illegal multibyte sequence
编码错误,可以通过指定字符集解决 : encoding = “utf-8”
io.UnsupportedOperation: not readable
文件不可读,可能是文件打开模式不对
UnboundLocalError:localvariable 'a'referenced before assignment
局部作用域引用错误,可能原因是 a变量为局部变量,未定义,不可修改
no module named wx
缺少wx模块,缺啥装啥...
sudo apt-get install python-wxtools
SystemError: cannot compile ‘Python.h’
没法解析Python的头文件,解决方法:
#先更新下源
sudo apt-get update#安装python-dev
sudo apt-get install python-dev
Nam
最后
以上就是优美电源最近收集整理的关于python not in range_Python 中常见错误总结的全部内容,更多相关python内容请搜索靠谱客的其他文章。
发表评论 取消回复