How can I create a simple message box in Python?

后端 未结 17 1327
心在旅途
心在旅途 2020-11-30 16:44

I\'m looking for the same effect as alert() in JavaScript.

I wrote a simple web-based interpreter this afternoon using Twisted.web. You basically submit

17条回答
  •  情深已故
    2020-11-30 17:36

    A recent message box version is the prompt_box module. It has two packages: alert and message. Message gives you greater control over the box, but takes longer to type up.

    Example Alert code:

    import prompt_box
    
    prompt_box.alert('Hello') #This will output a dialog box with title Neutrino and the 
    #text you inputted. The buttons will be Yes, No and Cancel
    

    Example Message code:

    import prompt_box
    
    prompt_box.message('Hello', 'Neutrino', 'You pressed yes', 'You pressed no', 'You 
    pressed cancel') #The first two are text and title, and the other three are what is 
    #printed when you press a certain button
    

提交回复
热议问题