Saturday, December 28, 2024
Google search engine
HomeLanguageswxPython – Create empty window

wxPython – Create empty window

wxPython is one of the most famous library in python for building GUI applications. In this first article of wxPython we will build an empty window using wxPython Library.

Steps to create empty window : 1. Import wx in your code 2. Create wx.App object 3. Create object for wx.Frame 4. Show frame using Show() function

Python3




# Import wx module
import wx
 
# Create a new app
app = wx.App(False)
 
# A Frame is a top-level window.# Create a new app
app = wx.App(False)
 
# A Frame is a top-level window.
frame = wx.Frame(None, wx.ID_ANY, "neveropen")
 
# Show the frame.
frame.Show(True)
# Handle events using MainLoop() function   
app.MainLoop()
 
frame = wx.Frame(None, wx.ID_ANY, "neveropen")
 
# Show the frame.
frame.Show(True)
 
# Handle events using MainLoop() function   
app.MainLoop()


As you run this program a new empty window will pop up on your screen with a labelneveropen. Output :

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments