答案 0 :(得分:1)
#A code to open three window
# Imports the wx package
import wx
# Creates an application object
app = wx.App()
# Creates a Frame
top = wx.Frame(None, title="Hello World", size=(300, 200))
# You can add this line if you want to add more controls to the frame
top1 = wx.Frame(None, title="Bonjour le monde", size=(300, 200))
top2 = wx.Frame(None, title ="Hallo Welt", size=(400, 200))
top.Show(True)
top1.Show(True)
top2.Show(True)
app.MainLoop()
答案 1 :(得分:0)
尝试以下代码段
#Imports the wx package
import wx
#Creates an application object
app = wx.App()
#Creates a Frame
top = wx.Frame(None, title = "Hello World", size = (300,200))
#You can add this line if you want to add more controls to the frame
panel = wx.Panel(top)
top.Show(True)
app.MainLoop()
我认为您看到的2个窗口是因为参数redirect=true
此处有详细解释:
https://www.tutorialspoint.com/wxpython/wxpython_hello_world.htm