class functions/methods 中的时钟安排一次错误

Clock Schedule Once Error in class functions/methods

我有一个 class 在 Kivy 应用程序中有两个功能。一个函数用 Clock.schedule_once(function_name).

调用第二个函数
class SivaCEFBrowser(Screen):
    def back_to_login(self):
        App.get_running_app().root.current='login_screen'
        App.get_running_app().root.transition.direction='right'

    def go_to_verify(self):
        App.get_running_app().root.current='verify_screen'
        App.get_running_app().root.transition.direction='left'

    def launch_cef_browser(self):
        sys.excepthook = cef.ExceptHook  # To shutdown all CEF processes on error.
        cef.Initialize()
        cef.CreateBrowserSync(url="https://www.google.com/", window_title="Hello World!")
        cef.MessageLoop()
        cef.Shutdown()

    def trigger_browser(self):
        Clock.schedule_once(self.launch_cef_browser)

当我的代码运行时,trigger_browser() 函数被调用,该函数又调用 launch_cef_browser()。这是我得到的错误:

我在这里错过了什么?

您需要定义 launch_cef_browser 函数,例如 def launch_cef_browser(self, *args)

kivy 正在使用 *args 参数对函数进行内部处理。