腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
python
说
“'
property
‘
对象
没有
’
format
‘
属性
”
python
、
sql
、
apache-spark
这是我的代码.. df = SQLContext.read.
format
('com.databricks.spark.csv')\ .options(header='true错误消息
说
“‘
property
”
对象
没有
属性
“
format
” 所以我认为格式有问题..我试着去读spark的代码,但是太难了。 如果有人能帮我一点忙,我将不胜感激。
浏览 18
提问于2020-07-16
得票数 0
回答已采纳
5
回答
Python
-类定义中的多个@
property
语句?
python
、
class
、
properties
、
decorator
、
python-decorators
我一直读到构造函数(
Python
中的def init )应该只设置赋值变量,计算出的实例
属性
应该通过
属性
来设置。另外,使用@
property
比使用Java风格的getter/setter更好。好的,但是我在这上面看到的每一个例子都只设置了一个
属性
。假设我有一个具有三个复杂
属性
的
对象
,需要计算、查询等等。如何表示多个@
property
、setters、删除?_x 因此,如果我有三个实例变量,这些变量是根据其他
属性
计算值的,它
浏览 7
提问于2014-02-20
得票数 9
回答已采纳
3
回答
Python
属性
和字符串格式
python
、
string
、
properties
、
formatting
我的印象是,使用.
format
()进行
python
字符串格式化可以正确地使用
属性
,而我得到的默认行为是字符串格式化的
对象
:>>> a =
property
format
(a=a)这是预期的行为吗?如果是的话,为
属性
实现特殊行为的好方法是什么
浏览 0
提问于2013-03-12
得票数 5
回答已采纳
1
回答
@
property
AttributeError:'bool‘
对象
没有
属性
'setter’-
python
python
、
python-3.x
、
properties
我有一个剧本是这样写的 @
property
global w return
浏览 14
提问于2022-09-17
得票数 0
1
回答
检查
Python
中
属性
的基础类型
python
、
properties
、
attributes
我试图弄清楚
python
中的
对象
是什么类型的(是一种方法?是一门课?是静态方法吗?)
属性
对象
prop.attr("__class__").attr("__name__")"将返回"
property
"。但是如何提取
属性
的类型呢?,我想知道它是否是浮点数、整数等等,。>>>Y
property
attributes: ['__class__', '__del
浏览 1
提问于2018-09-06
得票数 0
3
回答
什么是
属性
对象
?
python
、
python-2.7
、
properties
我对
python
并不陌生,但我在这里有一个非常基本的问题。我在使用
python
时发现有一个type
属性
<type '
property
'><
property
object at 0x0246C090> 但是
属性
对象
呢?它们的用途是什么?<em
浏览 0
提问于2015-05-05
得票数 23
回答已采纳
3
回答
AttributeError:“
property
”
对象
没有
属性
python
、
class
、
exception
、
object
、
properties
Python
(2.6)似乎是无缘无故地脱皮,有人能看到这个代码的问题吗?__db 失败,但有例外: 据我理解,一个
属性
在访问时会自动运行它的getter,那么为什么它会抱怨一个
属性
对象
,为什么它
没有</e
浏览 3
提问于2012-12-13
得票数 11
回答已采纳
1
回答
Python
:- 'Book‘
对象
没有
'add_
format
’
属性
python
xlwtCopycell_
format
1= rb.add_
format
({'bold': True, 'font_color': 'red'})wb=xlwtCopy(rb)我已经为
python</e
浏览 1
提问于2020-06-20
得票数 0
7
回答
如何在
Python
中创建新的未知或动态/扩展
对象
python
、
oop
、
class
、
object
、
expandoobject
在
python
中,我们如何在
没有
预定义类的情况下创建一个新
对象
,并在以后动态地向其添加
属性
?示例:dynamic_object.dynamic_
property
_a = "abc" dynamic_object.dynamic_
property
_b问题是我有一个序列化
对象
属性
的函数。出于这个原因,由于一些构造函数的限制,我不想创建一个预期类的
对象
,而是创建一个
浏览 32
提问于2012-12-24
得票数 41
回答已采纳
2
回答
如何以格式显示所有
属性
-表cmdlet
powershell
、
pscustomobject
我
没有
几个[pscustomobject]
对象
可以拥有所有
属性
。a1- - -a2 c2在advanceCollection中已知的所有
属
浏览 0
提问于2021-06-11
得票数 1
回答已采纳
3
回答
为什么要在构造函数中放置
属性
变量?
python
、
oop
、
constructor
、
properties
从其他语言中,我习惯于编写class
property
代码,然后我可以访问它,而无需在constructor中使用 def __init__(self):_value = 0 my_
property
(self):在几乎每个示例中,我处理的
属性
变量都在构造函数self._value = value 对我来说,这是
没有</
浏览 0
提问于2019-05-28
得票数 0
回答已采纳
2
回答
“‘bytes”
对象
没有
属性
“
format
”
python
、
python-2.7
、
format
、
string-interpolation
代码本身来自2.7,这就是为什么它现在不能正常工作的原因,并给出了'bytes‘
对象
没有
属性
'
format
’错误。我知道字节
没有
.
format
属性
,但我一直找不到另一种方法来插值下面的函数。year, qtr, ftype): url = b"https://www.sec.gov/Archives/edgar/full-index/{0}/QTR{1}
浏览 0
提问于2020-05-13
得票数 1
1
回答
AttributeError:在
python
中“NoneType”
对象
没有
属性
“
format
”
python-3.4
print('Split {0} rows into train={1} and test={2} rows').
format
(len(dataset), len(trainingSet), len(testSet)) 这里有一个AttributeError: 'NoneType' object has no attribute '
format
' for this lines。
浏览 0
提问于2017-01-23
得票数 1
1
回答
Pyglet:'str‘
对象
没有
属性
'audio_
format
’(
python
)
python
、
multithreading
、
audio
、
pyglet
但即使该文件以.mp3扩展名结尾,我仍然会收到以下错误:Traceback (most recent call last): self.run() File "C:\
Python
34\MP2.py&quo
浏览 3
提问于2015-04-23
得票数 0
回答已采纳
1
回答
用
Python
完全覆盖
属性
访问的正确方法是什么?
python
、
descriptor
这个朴素的类试图模仿基本
python
对象
的
属性
访问。dict和cls显式地存储
属性
和类。其结果是访问实例的.x将返回dict[x],如果失败,则返回cls.x。就像正常的物体一样。key == "__class__": else:但事情远
没有
那么简单想象一下,cls具有
属性
。执行Instance.some_
prope
浏览 3
提问于2012-10-03
得票数 3
5
回答
'NoneType‘
对象
没有
属性
'
format
’
python
字符串
python
、
string
我用
python
编写了一个程序来查找复合兴趣(更像是复制的)。这个程序是用
python
2编写的,我在最后一行.
format
(years)上遇到了问题。我需要知道我能用这段代码做什么,以及如何用
Python
3正确地编写它。最后一行中的{}部件也是如此。我应该把它改成%s吗?错误
说
: "AttributeError:'NoneType‘
对象
没有
属性
'
format
'“。+ monthly_inves
浏览 11
提问于2020-06-23
得票数 1
回答已采纳
2
回答
对象
不能json序列化。
python
、
json
、
serialization
在
python
中编写代码时,我得到了一个错误:“myObject类型的
对象
不能被JSON序列化” object_name.
property
_C = [] withopen(filename, 'w&
浏览 2
提问于2018-12-24
得票数 0
回答已采纳
1
回答
如何动态获取kotlin中的
对象
属性
kotlin
比如
说
,我有以下的
对象
..。...and --我想通过一个动态变量从中选择一个
属性
。ob.<
property
>将正常工作,但是如果我在编译时不知道<
property
>怎么办?是否有可能在kotlin中运行类似的ob[<
property
:str>] (如javascript、
python
等)?
浏览 2
提问于2020-08-08
得票数 2
3
回答
"|“符号在Django模板中是什么意思?
python
、
django
、
django-templates
我经常看到这样的东西:something.
property
|escape 这是什么意思?它在哪个最小的
python
版本中使用?编辑:问题被问错了,它
说
的是“在
Python
中是什么意思”,所以按位或答案是正确的,但不相关,请不要贬低他们。
浏览 2
提问于2009-01-06
得票数 8
回答已采纳
1
回答
Python
说
我
没有
属性
python
、
tkinter
AttributeError: 'Menu' object has no attribute 'potato_skins'
说
,当我运行这个程序时,
python
说
。当我取出“土豆皮”时,它
说
我
没有
面包的
属性
,等等。#Order Up!
浏览 1
提问于2017-08-15
得票数 0
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
一切皆对象——Python面向对象:属性访问的魔法(中)——property
Python里面这些点,据说80%的新手都会一脸懵逼
如何利用Python实现权限设置?有些人只怕连这个操作都没想到过!
python渐进-类4
Python中的@property特性
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券