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

后端 未结 10 2195
一生所求
一生所求 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:47

    TkInter is usually supplied with Python

    # File: hello1.py
    
    from Tkinter import *
    
    root = Tk()
    
    w = Label(root, text="Hello, world!")
    w.pack()
    
    root.mainloop()
    

    If you want something more native looking, you'll have to install something like wxpython

提交回复
热议问题