Python中文
首页
教程
问答
标签
搜索
登录
注册
如何访问其他类中的变量
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>在Functions类中,我想访问Frame类的变量。你知道吗</p> <p>如果有什么办法,请告诉我。你知道吗</p> <pre><code>class Functions(): def changeText(): ... ... I want to change the 'text' in the Frame class ex )Frame.text.SetFont('change text') </code></pre> <p>GUI元素</p> <pre><code>class Frame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, ....) .... .... self.text = wx.StaticText(panel, .....) </code></pre>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>您可以通过向函数发送类的实例来执行此操作:</p> <pre><code>class myClass(object): def __init__(self, text): self.text = text def changeText(input): input.text = "world" example = myClass("hello") changeText(example) </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何提高Djang的410误差
8 回答
如何提高doc2vec模型中两个文档(句子)的余弦相似度?
9 回答
如何提高Docker的日志限制?|[输出已剪裁,达到日志限制100KiB/s]
7 回答
如何提高DQN的性能?
8 回答
如何提高EasyOCR的准确性/预测?
8 回答
如何提高Euler#39项目解决方案的效率?
7 回答
如何提高F1成绩进行分类
9 回答
如何提高FaceNet的准确性
4 回答
如何提高fft处理的精度?
3 回答
如何提高Fibonacci实现对大n的精度?
2 回答
如何提高Flask与psycopg2的连接时间
3 回答
如何提高FosterCauer变换的scipy.signal.invres()的数值稳定性?
4 回答
如何提高gae查询的性能?
6 回答
如何提高GANs用于时间序列预测/异常检测的结果
6 回答
如何提高gevent和tornado组合的性能?
9 回答
如何提高googleappengin请求日志的吞吐量
4 回答
如何提高googlevision文本识别的准确性
4 回答
如何提高groupby/apply效率
7 回答
如何提高Gunicorn中的请求率
2 回答
如何提高G中的文件编码转换
9 回答