MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / easy_print

Function easy_print

PySimpleGUI/PySimpleGUI.py:18431–18499  ·  view source on GitHub ↗

Works like a "print" statement but with windowing options. Routes output to the "Debug Window" In addition to the normal text and background colors, you can use a "colors" tuple/string The "colors" or "c" parameter defines both the text and background in a single parm. It can be a

(*args, size=(None, None), end=None, sep=None, location=(None, None), relative_location=(None, None), font=None, no_titlebar=False,
               no_button=False, grab_anywhere=False, keep_on_top=None, do_not_reroute_stdout=True, echo_stdout=False, text_color=None, background_color=None, colors=None, c=None,
               erase_all=False, resizable=True, blocking=None, wait=None)

Source from the content-addressed store, hash-verified

18429
18430
18431def easy_print(*args, size=(None, None), end=None, sep=None, location=(None, None), relative_location=(None, None), font=None, no_titlebar=False,
18432 no_button=False, grab_anywhere=False, keep_on_top=None, do_not_reroute_stdout=True, echo_stdout=False, text_color=None, background_color=None, colors=None, c=None,
18433 erase_all=False, resizable=True, blocking=None, wait=None):
18434 """
18435 Works like a "print" statement but with windowing options. Routes output to the "Debug Window"
18436
18437 In addition to the normal text and background colors, you can use a "colors" tuple/string
18438 The "colors" or "c" parameter defines both the text and background in a single parm.
18439 It can be a tuple or a single single. Both text and background colors need to be specified
18440 colors -(str, str) or str. A combined text/background color definition in a single parameter
18441 c - (str, str) - Colors tuple has format (foreground, backgrouned)
18442 c - str - can also be a string of the format "foreground on background" ("white on red")
18443
18444 :param *args: stuff to output
18445 :type *args: (Any)
18446 :param size: (w,h) w=characters-wide, h=rows-high
18447 :type size: (int, int)
18448 :param end: end character
18449 :type end: (str)
18450 :param sep: separator character
18451 :type sep: (str)
18452 :param location: Location of upper left corner of the window
18453 :type location: (int, int)
18454 :param relative_location: (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
18455 :type relative_location: (int, int)
18456 :param font: specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
18457 :type font: (str or (str, int[, str]) or None)
18458 :param no_titlebar: If True no titlebar will be shown
18459 :type no_titlebar: (bool)
18460 :param no_button: don't show button
18461 :type no_button: (bool)
18462 :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
18463 :type grab_anywhere: (bool)
18464 :param background_color: color of background
18465 :type background_color: (str)
18466 :param text_color: color of the text
18467 :type text_color: (str)
18468 :param keep_on_top: If True the window will remain above all current windows
18469 :type keep_on_top: (bool)
18470 :param location: Location of upper left corner of the window
18471 :type location: (int, int)
18472 :param do_not_reroute_stdout: do not reroute stdout and stderr. If False, both stdout and stderr will reroute to here
18473 :type do_not_reroute_stdout: (bool)
18474 :param echo_stdout: If True stdout is sent to both the console and the debug window
18475 :type echo_stdout: (bool)
18476 :param colors: Either a tuple or a string that has both the text and background colors
18477 :type colors: (str) or (str, str)
18478 :param c: Either a tuple or a string that has both the text and background colors
18479 :type c: (str) or (str, str)
18480 :param resizable: if True, the user can resize the debug window. Default is True
18481 :type resizable: (bool)
18482 :param erase_all: If True when erase the output before printing
18483 :type erase_all: (bool)
18484 :param blocking: if True, makes the window block instead of returning immediately. The "Quit" button changers to "More"
18485 :type blocking: (bool | None)
18486 :param wait: Same as the "blocking" parm. It's an alias. if True, makes the window block instead of returning immediately. The "Quit" button changes to "Click to Continue..."
18487 :type wait: (bool | None)
18488 :return:

Callers

nothing calls this directly

Calls 3

_DebugWinClass · 0.85
_parse_colors_parmFunction · 0.85
PrintMethod · 0.80

Tested by

no test coverage detected