I have a problem with the rich library.
After installing it, I wrote in the code:
from rich import print
d = {
"employee1": "telephone: 123-456-789 -",
"employee2": "telephone: 098-654-321",
}
# and in the line with the code I set the color magenta bold:
print(
d.get(p, "[bold magenta] there is no such employee [/ bold magenta]!")
)
The problem is following. After the first attempt to change the color, the color of the text "there is no such employee" wasn't changed but the color of the telephone number changed. Then I removed the color formatting line, but still the phone number has magenta color.
Now, if change the text "there is no such employee" to red color, it change but the phone number is still in magenta.
Even when i remove text formatting and leave only from rich import print
i still got the phone number in magenta.
question from:
https://stackoverflow.com/questions/65915637/cant-reset-colours-after-rich-formatting 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…