-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
44 lines (34 loc) · 832 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import adorable
RED = adorable.color.from_hex(0x730005)
YELLOW = adorable.color.from_name("yellow")
ERROR = YELLOW.on(RED)
ERROR += adorable.BOLD
print(ERROR("an error occured"))
c = adorable.Color3bit.from_name("yellow")
#c |= adorable.Color8bit.from_name("red")
print(c.fg("Hello World"))
doc = "A {!r} Hello {} <red>W<b>or</b>ld</red>"
print(adorable.markup_xml(
doc,
style = dict(
b = adorable.BOLD,
red = RED
),
insert = adorable.insert(
"<b>big</b>",
"<b>escaped</b>"
)
))
print(adorable.markup_xml(
"Hello {!e} <{abc!r}>World</RED>",
adorable.filter_ansi(locals()),
adorable.insert(
"there",
abc = "RED"
)
))
print(f"Hello {RED:World}!")
with ERROR:
print("oh hello!")
1 / 0
print("we definetly have some issues here")