Python 3 WxPython Dropdown Choice List Example to Create List of Select or Comboboxes GUI Desktop App Full Project For Beginners

Python 3 WxPython Dropdown Choice List Example to Create List of Select or Comboboxes GUI Desktop App Full Project For Beginners

 

Welcome folks today in this blog post we will be looking at wxpython dropdown choice list or select or comboboxes. 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

class ChoiceFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, 'Choice Example', 
                size=(250, 200))
        panel = wx.Panel(self, -1)
        sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
                      'six', 'seven', 'eight']
        wx.StaticText(panel, -1, "Select one:", (15, 20))
        wx.Choice(panel, -1, (85, 18), choices=sampleList)

if __name__ == '__main__':
    app = wx.PySimpleApp()
    ChoiceFrame().Show()
    app.MainLoop()

 

 

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

See also  Python 3 Glob Library Script to Delete all Files and Folders Inside a Directory or Folder Full Project For Beginners

 

python app.py

 

 

Leave a Reply