Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

wxPython – Create empty window

  • Last Updated : 10 May, 2020

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 :

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course

1. Import wx in your code
2. Creare wx.App object
3. Create object for wx.Frame
4. Show frame using Show() function




# 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, "GeeksforGeeks")
  
# Show the frame.
frame.Show(True
# Handle events using MainLoop() function    
app.MainLoop()
  
frame = wx.Frame(None, wx.ID_ANY, "GeeksforGeeks")
  
# 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 label GeeksforGeeks.
Output :

My Personal Notes arrow_drop_up
Recommended Articles
Page :