diff options
Diffstat (limited to 'sources/pyside6/tests/util/color.py')
-rw-r--r-- | sources/pyside6/tests/util/color.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sources/pyside6/tests/util/color.py b/sources/pyside6/tests/util/color.py new file mode 100644 index 000000000..e85be28f3 --- /dev/null +++ b/sources/pyside6/tests/util/color.py @@ -0,0 +1,14 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +'''Function to print a colored line to terminal''' + + +def print_colored(message): + print(f'\033[0;31m{message}\033[m') # red + + +if __name__ == '__main__': + print('42 - the answer') + print_colored("But what's the question?") + print('Hum?') |