| 1 |
""" |
| 2 |
This script is used to test the py_print() wrapper that cmd2 provides as a replacement |
| 3 |
for the built-in print() function in the embedded Python environment. |
| 4 |
""" |
| 5 |
|
| 6 |
import sys |
| 7 |
|
| 8 |
from rich.text import Text |
| 9 |
|
| 10 |
|
| 11 |
print("hello", "world", sep="-") |
| 12 |
|
| 13 |
|
| 14 |
print("no newline", end=" ") |
| 15 |
print("here") |
| 16 |
|
| 17 |
|
| 18 |
print(1, 2, 3, sep=":", end=".") |
| 19 |
print() |
| 20 |
|
| 21 |
|
| 22 |
text = Text("I am Rich Text", style="blue") |
| 23 |
print(text) |
| 24 |
|
| 25 |
|
| 26 |
print("this goes to sys.stdout", file=sys.stdout) |
| 27 |
|
| 28 |
|
| 29 |
print("this goes to sys.stderr", file=sys.stderr) |