game.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:5622_PacMan_NN 作者: Brennan-M 项目源码 文件源码
def getplayername(self):
            """Ask the player his name, to go on the high-score list."""
            if NO_WX: return USER_NAME
            try:
              import wx
            except:
              print "Pacman Error: No module wx. Can not ask the user his name!"
              print "     :(       Download wx from http://www.wxpython.org/"
              print "     :(       To avoid seeing this error again, set NO_WX in file pacman.pyw."
              return USER_NAME
            app=wx.App(None)
            dlog=wx.TextEntryDialog(None,"You made the high-score list! Name:")
            dlog.ShowModal()
            name=dlog.GetValue()
            dlog.Destroy()
            app.Destroy()
            return name
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号