What's the simplest cross-platform way to pop up graphical dialogs in Python?

后端 未结 10 2203
一生所求
一生所求 2020-12-13 04:15

I want the simplest possible way to pop up simple dialogs in Python scripts. Ideally, the solution would:

  • Work on Windows, OS X, Gnome, KDE
  • Look like
10条回答
  •  眼角桃花
    2020-12-13 04:34

    wxPython is the best Python GUI library (IMO) and uses native widgets.

    import wx
    app = wx.PySimpleApp()
    dialog = wx.MessageDialog(None, 'wxPython is awesome!', 'Dialog Box', wx.OK|wx.ICON_INFORMATION)
    dialog.ShowModal()
    dialog.Destroy()
    app.MainLoop()
    

提交回复
热议问题