小编Jac*_*fin的帖子

不明白这个AttributeError的含义

我不断收到错误消息

AttributeError: 'NoneType' object has no attribute 'something'
Run Code Online (Sandbox Code Playgroud)

我所拥有的代码太长了,无法在此发布,但我想知道是否有人可以给出一般情况会导致这种情况的要点AttributeError,以及这NoneType应该是什么意思?

通常,您会收到代码出错的某个对象的名称,但由于它给了AttributeError我,我不确定如何缩小正在发生的事情,除了行号.

python attributeerror nonetype

263
推荐指数
6
解决办法
78万
查看次数

Python:从元组转换为字符串?

让我们说我有字符串:

    s = "Tuple: "
Run Code Online (Sandbox Code Playgroud)

和元组(存储在名为tup的变量中):

    (2, a, 5)
Run Code Online (Sandbox Code Playgroud)

我正在尝试让我的字符串包含值"Tuple:(2,a,5)".我注意到你不能只是连接它们.有谁知道最简单的方法吗?谢谢.

python string tuples

10
推荐指数
3
解决办法
8万
查看次数

标签 统计

python ×2

attributeerror ×1

nonetype ×1

string ×1

tuples ×1