def __init__(self):
        """ 初始化，创建一个窗口 """
            
        if platform.system() =="Windows":
            template = pyglet.gl.Config(alpha_size=8, sample_buffers=1, samples=4)
            configs = screen.get_matching_configs(template)

            if not configs:
                super().__init__()
            else:
                try:
                    super().__init__(config=configs[0])
                except Exception: 
                    super().__init__()
        else: # Mac or Linux
            super().__init__()
        
        self.set_caption("LeapLearner")
        self.set_location(location_x, location_y)
        self.axis_batch = None
def __init__ ( self ) : if platform . system ( ) == "Windows" : template = pyglet . gl . Config ( alpha_size = 8 , sample_buffers = 1 , samples = 4 ) configs = screen . get_matching_configs ( template ) if not configs : super ( ) . __init__ ( ) else : try : super ( ) . __init__ ( config = configs [ 0 ] ) except Exception : super ( ) . __init__ ( ) else : super ( ) . __init__ ( ) self . set_caption ( "LeapLearner" ) self . set_location ( location_x , location_y ) self . axis_batch = None
初始化，创建一个窗口