Web Analytics Made Easy - Statcounter
Skip to content

Debug Window Output

easy_print

Works like a "print" statement but with windowing options. Routes output to the "Debug Window"

easy_print(
    args = *<1 or N objects>,
    size = (None, None),
    end = None,
    sep = None,
    location = (None, None),
    font = None,
    no_titlebar = False,
    no_button = False,
    grab_anywhere = False,
    keep_on_top = False,
    do_not_reroute_stdout = True
)

Parameter Descriptions

Name Type Default Description
*args Any stuff to output
do_not_reroute_stdout bool True do not reroute stdout and stderr. If False, both stdout and stderr will reroute to here
end str None end character
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
keep_on_top bool False If True the window will remain above all current windows
location (int, int) (None, None) Location of upper left corner of the window
no_button bool False don't show button
no_titlebar bool False If True no titlebar will be shown
sep str None separator character
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
RETURN None None

easy_print_close

Close a previously opened EasyPrint window

easy_print_close()

eprint

This method is an alias for easy_print

Color Printing to Multiline Element of a Window

cprint

Color print to a multiline element in a window of your choice. Must have EITHER called cprint_set_output_destination prior to making this call so that the window and element key can be saved and used here to route the output, OR used the window and key parameters to the cprint function to specicy these items.

args is a variable number of things you want to print.

end - The end char to use just like print uses sep - The separation character like print uses text_color - The color of the text key - overrides the previously defined Multiline key window - overrides the previously defined window to output to background_color - The color of the background colors -(str, str) or str. A combined text/background color definition in a single parameter

There are also "aliases" for text_color, background_color and colors (t, b, c) t - An alias for color of the text (makes for shorter calls) b - An alias for the background_color parameter c - Tuple[str, str] - "shorthand" way of specifying color. (foreground, backgrouned) c - str - can also be a string of the format "foreground on background" ("white on red")

With the aliases it's possible to write the same print but in more compact ways: cprint('This will print white text on red background', c=('white', 'red')) cprint('This will print white text on red background', c='white on red') cprint('This will print white text on red background', text_color='white', background_color='red') cprint('This will print white text on red background', t='white', b='red')

cprint(
    args = *<1 or N objects>,
    end = None,
    sep = " ",
    text_color = None,
    t = None,
    background_color = None,
    b = None,
    colors = None,
    c = None,
    window = None,
    key = None
)

Parameter Descriptions

Name Type Default Description
*args Any stuff to output
b str None The background color of the line
background_color str None The background color of the line
c str) or Tuple[str, str] None Either a tuple or a string that has both the text and background colors
colors str) or Tuple[str, str] None Either a tuple or a string that has both the text and background colors
end str None end character
key Any None key of multiline to output to (if you want to override the one previously set)
sep str separator character
t str None Color of the text
text_color str None Color of the text
window Window None Window containing the multiline to output to (if you want to override the one previously set)
RETURN None None

cprint_set_output_destination

Sets up the color print (cprint) output destination

cprint_set_output_destination(
    window,
    multiline_key
)

Parameter Descriptions

Name Type Default Description
multiline_key Any Key for the Multiline Element where output will be sent
window Window The window that the cprint call will route the output to
RETURN None None