腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
2
回答
内置的非数据版本的财产?
python
__dict__['referTable'])vic@ubuntu:~/Desktop$
python3
test.py 1 property()函数是作为数据
描述符
实现的。因此,实例不能覆盖属性的行为。要隐藏它,我必须使用自己的
描述符
,而不是property内置
描述符
。是否存在像property这样的内置
描述符
,但哪一个是非数据的?
浏览 3
提问于2012-04-29
得票数 9
回答已采纳
1
回答
在python3.4中读取fork进程中的管道时出现"Bad file descriptor“
python
、
linux
、
pipe
os.execlp('
python3
','
python3
','child_test.py',str(pid),str(self.child_pipe_read) ,str(self.child_pipe_write))msg=os.read(self.child_pipe_read,32)然后我尝试向管道中写入: os.writeself.parent_pipe_write,(msg+
浏览 0
提问于2015-11-13
得票数 3
1
回答
关闭打开文件
描述符
的I/O对象
python
、
stdio
我碰到了一行代码,它使用文件
描述符
从stdin获取输入。sum(1-2*('-'in s)for s in[*open(0)][1:]))
python3
-c "print(sum(1-2*('-'in s
浏览 2
提问于2021-10-03
得票数 0
2
回答
python2与
python3
函数到方法的绑定
python-3.x
、
python-2.x
: pass B.method() # print both A and B instancesclass UnboundMethod:B.meth
浏览 1
提问于2012-08-29
得票数 10
1
回答
如果我在文件被锁定时启动一个进程,为什么没有在close()上释放文件锁?
python
、
locking
、
subprocess
如果我打开一个文件,获得一个锁,然后关闭该文件:file = open("some_file", "w")file.close()但是,如果在文件被锁定时启动后台进程:import subprocessfcntl.flock(file.fileno(), fcntl.LOCK_EX
浏览 3
提问于2015-01-08
得票数 1
回答已采纳
1
回答
Python从管道读取时的“坏文件
描述符
”
python
、
python-3.x
、
pipe
我正在尝试启动一个子进程,并将一个管道文件
描述符
传递给它来读取。然而,当我试图从子进程中的管道读取时,我得到了“坏文件
描述符
”,尽管我可以从父进程中的管道读取数据。subprocessimport os p = subprocess.Popen(["
python3
浏览 1
提问于2022-10-17
得票数 2
回答已采纳
1
回答
关闭与fdopen一起使用的文件
描述符
python
、
file-io
、
file-descriptor
如果有什么需要的话,我需要做什么来关闭我从os.open获得并随后与with os.fdopen一起使用的文件
描述符
?
浏览 1
提问于2014-07-27
得票数 2
回答已采纳
1
回答
其中一个"__get__“参数是多余的吗?
python
、
python-descriptors
如下所述: 所以,在我看来,有两种可能性: 那么,为
浏览 2
提问于2020-08-12
得票数 5
回答已采纳
1
回答
如何使用paramiko和pexpect?
python
、
paramiko
、
pexpect
Paramiko给了我一个文件
描述符
,但是。我需要一个用于读写的双向文件
描述符
,但我很难找到如何连接这些点的方法。#!/usr/bin/env
python3
import pexpect.fdpexpect sshc = paramiko.client.SSHClient
浏览 5
提问于2020-04-26
得票数 5
2
回答
python 3:在进程替换中,子进程无法打开文件
描述符
python
、
python-3.x
/test-process-subst.py one <(echo 2)contents: 1contents: 2contents: 这个问题似乎与
python3
与Python2不同,子进程无法打开父进程的文件
描述符
浏览 1
提问于2021-10-04
得票数 0
2
回答
str.join()和str().join()在Python中有什么区别?
python
、
python-3.x
我是Python新手,我正在使用
Python3
,我尝试将列表项连接到一个字符串中,我发现当我尝试str().join(lst)时,我成功地将列表项作为字符串获得,但是当我执行这个str.join(lst)时,我得到了: 在这种情况下,str和str()有什么区别?
浏览 0
提问于2017-09-18
得票数 2
回答已采纳
1
回答
不断创建自定义指标
描述符
会导致HTTP 500
google-cloud-monitoring
昨天早些时候,我试用了云监控应用编程接口,我创建了一个指标
描述符
,并使用最新的
python3
云监控库create_time_series调用向其中添加了一些时间序列数据。对结果感到满意,我使用库删除了
描述符
,这抛出了一个错误,因为我错误地传递了
描述符
的名称。我怀疑我错误地删除了整个custom.googleapis.com端点,这就是我无法创建新的指标
描述符
/时间序列数据的原因。是否有办法查看此终结点的状态或重新创建它?
浏览 18
提问于2021-07-13
得票数 0
2
回答
PyFile_Type替换为..?
c
、
cpython
、
python-3.2
我正在为Python3.2编译。我注意到gcc抱怨一个未声明的函数PyString_Type,所以我根据用它的替代函数PyBytes_Type替换了它。Python 3.x replaces the PyFile_Type extension type Unfortunately it doesn't make any of this directly availab
浏览 4
提问于2011-11-20
得票数 3
回答已采纳
2
回答
为什么@classmethod不是跨类保存的呢?
python
、
python-2.7
、
static-methods
、
class-method
、
python-descriptors
以下面的示例脚本为例: @classmethod print("I am class") def two(): one = A.one B.two()I am class Traceback (most rece
浏览 2
提问于2016-12-02
得票数 25
回答已采纳
1
回答
实例不传递给可调用类的`__call__`函数。
python
、
python-3.x
为什么ClassWithCallable实例不传递给__call__函数?我怎样才能做到这一点? def __call__(self, *args, **kwargs): print('Where is `ClassWithCallable` instance?') method = Callable() instance.met
浏览 2
提问于2022-04-28
得票数 0
回答已采纳
1
回答
从压缩流中读取了多少字节?
python
、
python-3.x
、
lzma
/usr/bin/env
python3
with lzma.open(filename, mode='rt') as f:
浏览 7
提问于2018-02-15
得票数 0
1
回答
与Python 2等效的选择器?
python
、
networking
、
standard-library
Python3
有selectors模块,它允许我们对文件
描述符
事件进行register,并且只在后面的代码select的另一部分中。
浏览 1
提问于2016-11-03
得票数 2
回答已采纳
1
回答
os.system()与os.popen()在使用bash进程替换时: ls:无法访问'/dev/fd/63':没有这样的文件或目录
python
/usr/bin/env
python3
import sys os.system(cmd) pipe = os.popen
浏览 4
提问于2021-04-15
得票数 1
回答已采纳
1
回答
开放/读/写/关闭的可接受用法?
python
、
file
下面的示例显示了使用os操作直接对文件
描述符
执行操作所花费的时间大大减少。除了文件对象的方便性之外,我还有什么缺点吗?
浏览 0
提问于2016-07-24
得票数 5
回答已采纳
2
回答
使用Python 3的静态类属性
python
、
python-3.x
、
class
、
static-methods
我知道像这样的东西适用于Python2,但是我在
Python3
上找不到类似的东西,我怀疑是因为改变了元类的工作方式。我如何取得类似的结果?
浏览 1
提问于2017-03-06
得票数 1
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
如何理解描述符
属性描述符
Python进阶——什么是描述符?
面向对象高阶-描述符与设计模式
一切皆对象——Python面向对象:描述符(中)
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券