V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
scene
V2EX  ›  Python

Python 小白想问一下 在书上找了一段代码 然后在 Python3.6 中输入运行后报错 请问该如何解决

  •  
  •   scene · 2018-05-30 13:14:36 +08:00 · 616 次点击
    这是一个创建于 2157 天前的主题,其中的信息可能已经有所发展或是发生改变。
    代码内容:
    import wx
    def hello(event):
    print ("Hello,word!")

    app=wx.App()

    win=wx.Frame(None,title="Hello,wxPython!",
    size=(200,100))

    button=wx.Button(win,label="Hello")
    button.Bind(wx.EVT_BUTTON,hello)
    win.show()
    app.MainLoop()


    错误提示:
    Traceback (most recent call last):
    File "C:\Users\infin\Desktop\Hello Word!.py", line 12, in <module>
    win.show()
    AttributeError: 'Frame' object has no attribute 'show'
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5141 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 05:41 · PVG 13:41 · LAX 22:41 · JFK 01:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.