# 主窗口类MainWindow
class MainWindow(wx.Frame):
# 类变量file_path记录文件路劲
file_path = ''
def __init__(self):
super().__init__(None, title="成绩分析", size=(300, 570))
panel = wx.Panel(self)
# 设置居中,最大最小尺寸
self.Center()
self.SetMaxSize((300, 570))
self.SetMinSize((300, 570))
https://blog.csdn.net/rao356/article/details/120708350
参考一下这个