推荐学习书目
› 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 · May 30, 2018 · 1022 views
    This topic created in 3039 days ago, the information mentioned may be changed or developed.
    代码内容:
    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'
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   886 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:50 · PVG 03:50 · LAX 12:50 · JFK 15:50
    ♥ Do have faith in what you're doing.