Python 3 WxPython Question Yes or No Message Dialog or Modal GUI Desktop App Full Project For Beginners

Python 3 WxPython Question Yes or No Message Dialog or Modal GUI Desktop App Full Project For Beginners

 

Welcome folks today in this blog post we will be looking at wxpython question yes or no message dialog. All the full source code of the application is given below.

 

 

Get Started

 

 

In order to get started you need to install the below library using the pip command as shown below

 

pip install wxpython

 

After installing this library you need to make an app.py file and copy paste the following code

 

app.py

 

import wx

if __name__ == "__main__":
    app = wx.PySimpleApp()
    dlg = wx.MessageDialog(None, "Is this explanation OK?",
                          'A Message Box',
                          wx.YES_NO | wx.ICON_QUESTION)
    retCode = dlg.ShowModal()
    if (retCode == wx.ID_YES):
        print("yes")
    else:
        print("no")
    dlg.Destroy()

    retCode = wx.MessageBox("Is this way easier?", "Via Function",
            wx.YES_NO | wx.ICON_QUESTION)

 

 

If you execute the above python script by typing the below command

See also  Python 3 Script to Replace Spaces with New Lines in Text File Full Project For Beginners

 

python app.py

 

 

Leave a Reply