DebugWindow

class ttkwidgets.DebugWindow(master=None, title='Debug window', stdout=True, stderr=False, width=70, autohidescrollbar=True, **kwargs)[source]

Bases: Tkinter.Toplevel

A Toplevel that shows sys.stdout and sys.stderr for Tkinter applications

__init__(master=None, title='Debug window', stdout=True, stderr=False, width=70, autohidescrollbar=True, **kwargs)[source]

Create a Debug window.

Parameters:
  • master (widget) – master widget
  • stdout (bool) – whether to redirect stdout to the widget
  • stderr (bool) – whether to redirect stderr to the widget
  • width (int) – window width (in characters)
  • autohidescrollbar (bool) – whether to use an AutoHideScrollbar or a ttk.Scrollbar
  • kwargs – options to be passed on to the tk.Toplevel initializer
quit()[source]

Restore previous stdout/stderr and destroy the window.

save()[source]

Save widget content.

write(line)[source]

Write line at the end of the widget.

Parameters:line (str) – text to insert in the widget