MCPcopy Create free account
hub / github.com/cztomczak/cefpython / main

Function main

examples/tkinter_.py:46–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44
45
46def main():
47 logger.setLevel(_logging.DEBUG)
48 stream_handler = _logging.StreamHandler()
49 formatter = _logging.Formatter("[%(filename)s] %(message)s")
50 stream_handler.setFormatter(formatter)
51 logger.addHandler(stream_handler)
52 logger.info("CEF Python {ver}".format(ver=cef.__version__))
53 logger.info("Python {ver} {arch}".format(
54 ver=platform.python_version(), arch=platform.architecture()[0]))
55 logger.info("Tk {ver}".format(ver=tk.Tcl().eval('info patchlevel')))
56 assert cef.__version__ >= "55.3", "CEF Python v55.3+ required to run this"
57 sys.excepthook = cef.ExceptHook # To shutdown all CEF processes on error
58 # Tk must be initialized before CEF otherwise fatal error (Issue #306)
59 root = tk.Tk()
60 app = MainFrame(root)
61 settings = {}
62 if MAC:
63 settings["external_message_pump"] = True
64 cef.Initialize(settings=settings)
65 app.mainloop()
66 logger.debug("Main loop exited")
67 cef.Shutdown()
68
69class MainFrame(tk.Frame):
70

Callers 1

tkinter_.pyFile · 0.70

Calls 1

MainFrameClass · 0.70

Tested by

no test coverage detected