python --error整理(不定时更新)

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值