Tkinter messagebox without window?

前端 未结 4 1763
别那么骄傲
别那么骄傲 2020-11-30 10:08

I want to show an info window in my python script running on ubuntu. I\'m using the following code:

import tkMessageBox
tkMessageBox.showinfo(\"Say Hello\",          


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 10:34

    To avoid a "flash" as the root window is created, use this slight variation on the accepted answer:

    import Tkinter as tk
    root = tk.Tk()
    root.overrideredirect(1)
    root.withdraw()
    tkMessageBox.showinfo("Say Hello", "Hello World")
    

提交回复
热议问题