博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python --error整理(不定时更新)
阅读量:6969 次
发布时间:2019-06-27

本文共 788 字,大约阅读时间需要 2 分钟。

1.TabError: inconsistent use of tabs and spaces in indentation

 Python 中需要用tab 键来空格

 

2.SyntaxError: invalid character in identifier

中英文没有切换好

 

3.TabError: inconsistent use of tabs and spaces in indentation

空格问题;;

 

4.name.login_attempts()

TypeError: 'int' object is not callable

调用int时出错:需要重新定义变量名

 

 

5. IndentationError: expected an indented block

在定义类之后没有再定义了

 

6. super().__init__(make, module, year)

TypeError: object.__init__() takes no arguments

继承error

class ElectricCar(Car)括号内的car没有写,所以出现了takes no arguments 的错误。

 

7. IndentationError: unexpected indent

没有缩进,把空格去掉。

 

8.SyntaxError: invalid character in identifier, 

一直找不到问题点的话,请确保代码行内没有夹杂中文的空格,tab等,非文字字符

9. can't find '__main__' module in ''

没有先保存,我是在sublime text中执行的,忘记先保存再运行,因此报了这样的错

转载于:https://www.cnblogs.com/clairedandan/p/10848485.html

你可能感兴趣的文章
Spring Boot启动流程详解(一)
查看>>
接口数据一致性校验工具
查看>>
快马和慢马
查看>>
vs中快捷键“转到定义(F12)”后再转回
查看>>
抽象工厂之更换皮肤
查看>>
在WPF的WebBrowser控件中抑制脚本错误
查看>>
C#性能优化:延迟初始化Lazy<T>
查看>>
设计模式笔记——设计模式原则总结
查看>>
浏览器解析html全过程详解
查看>>
sqlserver中有没有类似oracle中dual这样的表
查看>>
阿里双十一背后的技术
查看>>
试用许可证的疑惑
查看>>
使用Button组件
查看>>
各Spring-Boot-Starters介绍(转)
查看>>
测试赛3部分题题解及总结
查看>>
阿里巴巴为什么主推HSF?比Dubbo有哪些优势?
查看>>
AI技术落地医疗搜索 搜狗明医独家首推“湿疹痱子识别”功能
查看>>
中国又一项技术让世界叹服,世界500强抢着合作!
查看>>
年薪百万都招不来人,AI与区块链的技术人才有多稀缺?|技术大会
查看>>
一起撸个朋友圈吧 - 重构
查看>>