【wxpython】py:603: wxPyDeprecationWarning: Using deprecated class PySimpleApp.
来源:互联网 发布:如何联系淘宝小二 编辑:程序博客网 时间:2024/06/01 19:25
提示错误:
py:603: wxPyDeprecationWarning: Using deprecated class PySimpleApp. Use :class:`App` instead. app = wx.PySimpleApp()
代码:
import wxclass MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, "My Frame", size=(300, 300)) panel = wx.Panel(self, -1) panel.Bind(wx.EVT_MOTION, self.OnMove) wx.StaticText(panel, -1, "Pos:", pos=(10, 12)) self.posCtrl = wx.TextCtrl(panel, -1, "", pos=(40, 10)) def OnMove(self, event): pos = event.GetPosition() self.posCtrl.SetValue("%s, %s" % (pos.x, pos.y))if __name__ == '__main__': app = wx.PySimpleApp() frame = MyFrame() frame.Show(True) app.MainLoop()
解决方案:
app = wx.PySimpleApp()
修改为:
app = wx.App()
原因: wx.PySimpleApp()
这个方法在wxPython2.9
后已经被弃用。
阅读全文
0 0
- 【wxpython】py:603: wxPyDeprecationWarning: Using deprecated class PySimpleApp.
- wxPyDeprecationWarning: Using deprecated class PySimpleApp.
- python 报错 wxPyDeprecationWarning: Using deprecated class PySimpleApp.
- a simple wxPython example2 --wx.PySimpleApp() version
- wxPython: Using wx.Timers
- py class
- <PY><wxPython>网关登录客户端
- Warning: Using innodb_additional_mem_pool_size is DEPRECATED
- <PY><wxPython>定时关机小程序
- using template in class
- Using the Debug Class
- Using String class constructors
- Using the UIComponent class
- Using the StringBuilder Class
- Using the FlexPrintJob class
- Deprecated: main(): The Mongo class is deprecated, please use the MongoClient class in
- wxPython
- wxPython
- #文末福利|云栖大会门票限时赠送# 10.11云栖大会Clouder Lab “十分钟搭建共享应用”,手把手教你Serverless架构下的应用实现
- oracle 统计分析函数
- 二分图匹配
- Virtualbox主机和虚拟机之间文件夹共享及双向拷贝(Windows<->Windows, Windows<->Linux)
- centos安装node试试
- 【wxpython】py:603: wxPyDeprecationWarning: Using deprecated class PySimpleApp.
- demo_5. python3.6字符串操作总结
- Java9教程(持续更新...)
- 电影网站增删改查-4 spring boots/MVC/neo4j/thymeleaf 源码分析 实现View 新增过程
- go学习(十二)——Go 语言错误与异常处理机制
- Centos安装和破解Confluence
- Qt布局最简单程序
- Java基础你要知道的事情------Cookie
- 词向量源码解析:(5.9)ngram2vec源码解析之word2vecf.py