Wxpython is a wxwidgets cross-platform GUI component written in C + +
Installing Wxpython
Pip Install Wxpython
ImportWXdefLoad (Event): File= open (filename. GetValue (), encoding='UTF8') contents. SetValue (File.read ()) File.close ()defSave (Event): File= open (filename. GetValue (),'W', encoding='UTF8') File.write (contents. GetValue ()) File.close () app= WX. APP ()#responsible for all initialization behind the scenes, if, WX. APP () is not available, then use WX. Pysimpleapp () instead, but is about to be deprecated#app = wx. Pysimpleapp ()Win = WX. Frame (None, title='GUI Test', Size= (410, 335))#The size of the entire windowbkg=WX. Panel (Win) Loadbutton= WX. Button (bkg, label='Open') Loadbutton.bind (WX. Evt_button, load) Savebutton= WX. Button (bkg, label='Save') Savebutton.bind (WX. evt_button,save) filename=WX. Textctrl (bkg) Contents= WX. Textctrl (bkg, Style=wx.te_multiline |WX. HScroll) Hbox=WX. Boxsizer () Hbox. ADD (filename, proportion=1, flag=WX. EXPAND) Hbox. ADD (Loadbutton, proportion=0, Flag=wx. Left, border=5) Hbox. ADD (Savebutton, proportion=0, Flag=wx. Left, border=5) VBox=WX. Boxsizer (WX. VERTICAL) VBox. ADD (Hbox, proportion=0, Flag=wx. EXPAND | Wx. All, border=5) VBox. ADD (contents, proportion=0, Flag=wx. EXPAND | Wx. Left | Wx. BOTTOM | Wx. Right, border=5.) bkg. Setsizer (VBox) win. Show ()#Hold windowApp. Mainloop ()#the window will remain hidden until it is hold.
Demo
End
First knowledge of Wxpython