Questions tagged [rich]

Rich is a Python library for rich text and beautiful formatting in the terminal.

99 questions
0
votes
2 answers

ModuleNotFoundError: No module named 'rich.logging' in python

I have init.py that includes this code and I get the error below the code: from __future__ import annotations import logging from rich.logging import RichHandler FORMAT = "%(message)s" logging.basicConfig( format=FORMAT, datefmt="[%X] ",…
Amir
  • 1,667
  • 3
  • 23
  • 42
0
votes
1 answer

Python pyats and rich module

I'm trying to print the output from a pyats to the rich module. Here is the output { "cdp": { "index": { "1": { "capability": "R S I", "device_id": "SW22.lab.com", "hold_time": 150, "local_interface":…
tcpip
  • 11
  • 4
0
votes
0 answers

Sorting classes based on multiple attributes

I am currently using Python 3.9.1 or 3.8 (depending on what device I’m on) I was reading an article on Medium.com regarding sorting using multiple keys from a dictionary using the operator module. I had implemented a class that uses the built-in…
epsilonv
  • 1
  • 3
0
votes
2 answers

How to replace/extend Django shell with Rich?

Django allows to replace its default shell with more capable ones like ipython and bpython. Is there a way to replace/extend the default Django shell with Rich?
Den Kasyanov
  • 870
  • 2
  • 11
  • 27
-1
votes
1 answer

Creating two dimensional list out of other lists that are not the same size

I have four lists apps = ["App 1", "App 2", "App 3", "App 4"] devices = ["device1"] groups = ["group1", "group2", "group3", "group4"] rules_name = ["rule1", "rule2", "rule3", "rule4", "rule5"] and I need to iterate over each list adding the index…
glob
  • 180
  • 2
  • 10
-1
votes
1 answer

print ouputs pink text

I am using the python library "rich" to print text. If I print with the default style, the text is printed to the console white on black as it should be. But if you print the word "wordn(" for example, it will get printed pink. Basically whenever…
TheUltimateOptimist
  • 1,089
  • 4
  • 19
-2
votes
1 answer

Issues Handling ChatGPT Streaming Response in Terminal using OpenAI API - Using Python, rich library

I am trying to integrate the openAi API model - gpt-4 with Terminal to enable ChatGPT. My objective is to receive streaming responses from ChatGPT and print them in the Terminal. Although I can successfully print the entire response without…
sparker
  • 1,666
  • 4
  • 21
  • 35
-2
votes
1 answer

Pls help me with this while loop nested in if condition nested in for loop 0_0

I'm trying to extract a certain amount of numbers from a range of 17 numbers. However if a number is not valid (decided by the user) I need to extract another unique nuber that is different from the number not valid and the numbers that has been…
Edoardo Balducci
  • 332
  • 1
  • 10
-2
votes
1 answer

How can I make a verified symbol in Python?

I am working on a project that uses Python to download and install applications. The repos where the application info is stored has a line in json that states if the user is verified, this is then converted to a True or False variable. After…
Daniel
  • 32
  • 9
1 2 3 4 5 6
7