In [1]:
from deva import *
from rich.console import Console
console = Console()
In [2]:
range<<10>>sum>>log#>>debug
Out[2]:
In [3]:
from termcolor import colored,cprint
print(colored('hello', 'red'), colored('world', 'green'))
print(colored("hello red world", 'red'))
In [4]:
print_red_on_cyan = (lambda x: colored(x, 'red', 'on_cyan'))@P
'ddd'>>print_red_on_cyan>>print
In [6]:
from rich.console import Console
console = Console()
test_data = [
{"jsonrpc": "2.0", "method": "sum", "params": [None, 1, 2, 4, False, True], "id": "1",},
{"jsonrpc": "2.0", "method": "notify_hello", "params": [7]},
{"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": "2"},
]
def test_log():
enabled = False
context = {
"foo": "bar",
}
movies = ["Deadpool", "Rise of the Skywalker"]
console.log("Hello from", console, "!")
console.log(test_data, log_locals=True)
test_log()