我是靠谱客的博主 优美电源,这篇文章主要介绍python not in range_Python 中常见错误总结,现在分享给大家,希望可以做个参考。

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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(128)

评论列表共有 0 条评论

立即
投稿
返回
顶部