Posts: 257
Threads: 108
Joined: May 2019
Mar-15-2022, 02:13 PM
(This post was last modified: Mar-15-2022, 02:13 PM by korenron.)
Hello,
I want to do the following
I'm reading canbus data and I want to "save" every ID - then show if I got different data from this PID , and show the differnet (in color)
for test I saved only the first 10 ID I got
I need to save the data for that ID then compare it with old value
but how do I continue?
data_byte = message.data
data_temp = [f"{byte:02x}" for byte in data_byte]
Data = ' '.join(data_temp)
PID = f"{pid_int:08x}"
PID = PID.upper()
if str(PID) not in str(PID_List) and len(PID_List) < 10:
PID_List.append(PID)
print(PID)
else:
pass
# print('I have this pid in list')
if PID in str(PID_List):
print(str(TS) + ": " + PID + ": " + Data) for example this is the data I'm reading
I can see that ID "18FF20EF" is sending 5 differnet data
how can I print\show it ?
2022-03-15 15:21:19.479516: 18FF20EF: ff 7d e4 04 7d ff 00 13
2022-03-15 15:21:19.484668: 00FF012F: 00 7d 00 7d 00 7d ff ff
2022-03-15 15:21:19.485292: 00FF022F: ff ff ff ff ff ff ff ff
2022-03-15 15:21:19.486379: 00FF032F: 00 20 00 00 3f ff c0 80
2022-03-15 15:21:19.489523: 18FF20EF: ff 7d e4 04 7d ff 00 11
2022-03-15 15:21:19.490570: 0CF101A7: 07 00 d9 08 00 00 b9 9e
2022-03-15 15:21:19.491136: 0CFE6CEE: 4b ff ff c4 00 fe e6 08
2022-03-15 15:21:19.491688: 18F120F0: 00 fa 19 30 13 6d 4f 4e
2022-03-15 15:21:19.492545: 0CF00300: fd 00 ff ff ff ff ff ff
2022-03-15 15:21:19.499572: 18FF20EF: ff 7d e4 04 7d ff 00 22
2022-03-15 15:21:19.509498: 18FF20EF: ff 7d e0 04 7d ff 00 99
2022-03-15 15:21:19.510157: 00FF012F: 00 7d 00 7d 00 7d ff ff
2022-03-15 15:21:19.510678: 0CF101A7: 07 00 d2 08 00 00 b9 9f
2022-03-15 15:21:19.511279: 00FF022F: ff ff ff ff ff ff ff ff
2022-03-15 15:21:19.511836: 0CFE6CEE: 4b ff ff c4 00 fe e6 08
2022-03-15 15:21:19.512420: 00FF032F: 00 20 00 00 3f ff c0 80
2022-03-15 15:21:19.519575: 18FF20EF: ff 7d e4 04 7d ff 00 fa I thought to do something like this
if PID in str(PID_List):
test = PID+ ":"+ Data
if Old_Data in test:
print('same')
else:
print('PID ' + PID)
print('Old Data is ' + Old_Data+ "\n\r"+ 'New Data is ' + Data)
Old_Data=Data but it show me the data from the last time he read , and not from the last PID he read
so I allways get differnet (the data is from the previous PID I read and its not the same PID)
hope the question is clear and someone can guide\help
basically I want to do a cansniffer like show in this video (start to play at 1:50)
CanSniffer
Thanks ,
Posts: 6,323
Threads: 16
Joined: Feb 2020
Mar-15-2022, 02:41 PM
(This post was last modified: Mar-15-2022, 06:03 PM by deanhystad.)
This uses a dictionary to keep the last value for each ID and only prints a message if the value changed for that ID.
canbus_data = [
"2022-03-15 15:21:19.479516: 18FF20EF: ff 7d e4 04 7d ff 00 13",
"2022-03-15 15:21:19.484668: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.485292: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.486379: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.489523: 18FF20EF: ff 7d e4 04 7d ff 00 11",
"2022-03-15 15:21:19.490570: 0CF101A7: 07 00 d9 08 00 00 b9 9e",
"2022-03-15 15:21:19.491136: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.491688: 18F120F0: 00 fa 19 30 13 6d 4f 4e",
"2022-03-15 15:21:19.492545: 0CF00300: fd 00 ff ff ff ff ff ff",
"2022-03-15 15:21:19.499572: 18FF20EF: ff 7d e4 04 7d ff 00 22",
"2022-03-15 15:21:19.509498: 18FF20EF: ff 7d e0 04 7d ff 00 99",
"2022-03-15 15:21:19.510157: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.510678: 0CF101A7: 07 00 d2 08 00 00 b9 9f",
"2022-03-15 15:21:19.511279: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.511836: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.512420: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.519575: 18FF20EF: ff 7d e4 04 7d ff 00 fa",
]
pidvalues = {} # Last value for each ID
for msg in canbus_data:
date, id, values = msg.split(": ")
if pidvalues.get(id, None) != values:
print(f"{id}: {values}")
pidvalues[id] = values Output: 18FF20EF: ff 7d e4 04 7d ff 00 13
00FF012F: 00 7d 00 7d 00 7d ff ff
00FF022F: ff ff ff ff ff ff ff ff
00FF032F: 00 20 00 00 3f ff c0 80
18FF20EF: ff 7d e4 04 7d ff 00 11
0CF101A7: 07 00 d9 08 00 00 b9 9e
0CFE6CEE: 4b ff ff c4 00 fe e6 08
18F120F0: 00 fa 19 30 13 6d 4f 4e
0CF00300: fd 00 ff ff ff ff ff ff
18FF20EF: ff 7d e4 04 7d ff 00 22
18FF20EF: ff 7d e0 04 7d ff 00 99
0CF101A7: 07 00 d2 08 00 00 b9 9f
18FF20EF: ff 7d e4 04 7d ff 00 fa
Generating output like the CanSniffer will be more challenging. You'll need to move the cursor and set text colors. Do you know how to do that?
Posts: 257
Threads: 108
Joined: May 2019
but will it work in realtime?
meaning while I'm reading data ,and not from final list?
Posts: 6,323
Threads: 16
Joined: Feb 2020
Mar-15-2022, 06:39 PM
(This post was last modified: Mar-15-2022, 07:42 PM by deanhystad.)
I used a list because I don't have realtime data. The dictionary doesn't care where the data comes from.
Your idea didn't work because you didn't associate the values with a device. You only remembered the last data, not the last data from 00FF022F. The dictionary solves that problem, creating a "Old_data" variable for each device ID. When new data has the device ID 00FF022F, pidvalues[00FF022F] will return the last values we got from 00FF022F so you can compare.
Posts: 257
Threads: 108
Joined: May 2019
Mar-20-2022, 09:31 AM
(This post was last modified: Mar-20-2022, 09:31 AM by korenron.)
Yes , this was my problem - didn't know how to associate data with ID
it's seem to be working - great !
Thank!
another small visual issue
it there a way to know what is the differnet and then paint it in color?
for eample
this is the reading (after the change you told me to do )
18FF20EF: 00 7d 00 00 7d ef 00 7d
0CD22F27: 40 00 00 00 00 00 00 00
18FEF117: 04 00 00 00 00 00 00 00
104C1A23: f7 0c f8 0c f8 0c f8 0c
0CFF104A: 80 00 00 00 00 00 00 08
104C1A23: f8 0c f8 0c f8 0c f8 0c
104C1A23: f7 0c f8 0c f8 0c f8 0c
104C1A23: f8 0c f8 0c f8 0c f9 0c
104C1A23: f7 0c f8 0c f8 0c f9 0c
104C1A23: f8 0c f8 0c f8 0c f9 0c as you can see in massage "104C1A23" byte1 is "playing" f7-f8-f7....
is there any command that can comapre old to new - and point out only the differnet in color?
*** in the end I need a simple user to be able to see it right away ****
***
I have found this
mport difflib
differences = difflib.ndiff('f8 0c f8 0c f8 0c f8 0c', 'f7 0c f8 0c f8 0c f8 0c')
for difference in differences:
print(difference) the output is
f
- 8
+ 7
0
c
f
8
0
c
f
8
0
c
f
8
0
c this is what I thought I can do:
1. I need it to take only the "+" ot the "-" - it's doesn't metter to me . then I will know where is the change
2. find the index if the cahnge in the new_data
3. color the index - and then print the new_data while the chagne is marked.
Thanks (again),
Posts: 257
Threads: 108
Joined: May 2019
I have done this
canbus_data = [
"2022-03-15 15:21:19.479516: 18FF20EF: ff 7d e4 04 7d ff 00 13",
"2022-03-15 15:21:19.484668: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.485292: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.486379: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.489523: 18FF20EF: ff 7d e4 04 7d ff 00 11",
"2022-03-15 15:21:19.490570: 0CF101A7: 07 00 d9 08 00 00 b9 9e",
"2022-03-15 15:21:19.491136: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.491688: 18F120F0: 00 fa 19 30 13 6d 4f 4e",
"2022-03-15 15:21:19.492545: 0CF00300: fd 00 ff ff ff ff ff ff",
"2022-03-15 15:21:19.499572: 18FF20EF: ff 7d e4 04 7d ff 00 22",
"2022-03-15 15:21:19.509498: 18FF20EF: ff 7d e0 04 7d ff 00 99",
"2022-03-15 15:21:19.510157: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.510678: 0CF101A7: 07 00 d2 08 00 00 b9 9f",
"2022-03-15 15:21:19.511279: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.511836: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.512420: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.519575: 18FF20EF: ff 7d e4 04 7d ff 00 fa",
]
pidvalues = {} # Last value for each ID
for msg in canbus_data:
date, id, values = msg.split(": ")
Old_Value = pidvalues.get(id, None)
if Old_Value != values:
i = 0
# print("---->>>>", Old_Value)
if Old_Value is not None:
while i < len(Old_Value):
Change_index = []
if Old_Value[i] != values[i]:
print(f"index is {i} , char is {Old_Value[i]} , {values[i]}")
Change_index.append(i)
i += 1
print(f"{id}: {values} -- { now how do I print in color just the wanted index I have put in the Change_index list?
Posts: 6,323
Threads: 16
Joined: Feb 2020
Mar-20-2022, 12:04 PM
(This post was last modified: Mar-20-2022, 12:34 PM by deanhystad.)
How do you print in color? The traditional way to print color is uses the curses library, but I think that only works on linux, maybe mac. If you can't use curses then you need to look for other libraries that let you control how information is displayed in the terminal. What have you tried?
If you don't know where to start:
https://www.geeksforgeeks.org/print-colo...e0135fb258
Using the ANSI escape character sequences I quickly came up with this:
def red(c):
return f"\033[91m{c}\033[00m"
def black(c):
return f"\033[98m{c}\033[00m"
def mydiff(s1, s2):
return "".join([black(c2) if c1 == c2 else red(c2) for c1, c2 in zip(s1, s2)])
a = 'f8 0c f8 0c f8 0c f8 0c'
b = 'f7 1d f8 0c f8 0c f8 0c'
print(mydiff(a, b)) It is pretty raw, but it does print different colored text.
You will also have to position the cursor somehow.
Posts: 7,137
Threads: 122
Joined: Sep 2016
Mar-20-2022, 12:27 PM
(This post was last modified: Mar-20-2022, 12:27 PM by snippsat.)
Python has a big star✨ when comes to print color in console and that is Rich
korenron your index adding in last code don't work at all.
I use deanhystad code and add index there,then show i couple of ways with Rich.
from rich import print
from rich.console import Console
console = Console()
canbus_data = [
"2022-03-15 15:21:19.479516: 18FF20EF: ff 7d e4 04 7d ff 00 13",
"2022-03-15 15:21:19.484668: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.485292: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.486379: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.489523: 18FF20EF: ff 7d e4 04 7d ff 00 11",
"2022-03-15 15:21:19.490570: 0CF101A7: 07 00 d9 08 00 00 b9 9e",
"2022-03-15 15:21:19.491136: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.491688: 18F120F0: 00 fa 19 30 13 6d 4f 4e",
"2022-03-15 15:21:19.492545: 0CF00300: fd 00 ff ff ff ff ff ff",
"2022-03-15 15:21:19.499572: 18FF20EF: ff 7d e4 04 7d ff 00 22",
"2022-03-15 15:21:19.509498: 18FF20EF: ff 7d e0 04 7d ff 00 99",
"2022-03-15 15:21:19.510157: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.510678: 0CF101A7: 07 00 d2 08 00 00 b9 9f",
"2022-03-15 15:21:19.511279: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.511836: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.512420: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.519575: 18FF20EF: ff 7d e4 04 7d ff 00 fa",
]
pidvalues = {} # Last value for each ID
for index, msg in enumerate(canbus_data):
date, id, values = msg.split(": ")
if pidvalues.get(id, None) != values:
console.print(f"{index} [bold green]{id}[/]: [bold red]{values}[/]")
pidvalues[id] = values
Want a Table format in console Rich can to that to.
from rich.console import Console
from rich.table import Table
console = Console()
canbus_data = [
"2022-03-15 15:21:19.479516: 18FF20EF: ff 7d e4 04 7d ff 00 13",
"2022-03-15 15:21:19.484668: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.485292: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.486379: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.489523: 18FF20EF: ff 7d e4 04 7d ff 00 11",
"2022-03-15 15:21:19.490570: 0CF101A7: 07 00 d9 08 00 00 b9 9e",
"2022-03-15 15:21:19.491136: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.491688: 18F120F0: 00 fa 19 30 13 6d 4f 4e",
"2022-03-15 15:21:19.492545: 0CF00300: fd 00 ff ff ff ff ff ff",
"2022-03-15 15:21:19.499572: 18FF20EF: ff 7d e4 04 7d ff 00 22",
"2022-03-15 15:21:19.509498: 18FF20EF: ff 7d e0 04 7d ff 00 99",
"2022-03-15 15:21:19.510157: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.510678: 0CF101A7: 07 00 d2 08 00 00 b9 9f",
"2022-03-15 15:21:19.511279: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.511836: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.512420: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.519575: 18FF20EF: ff 7d e4 04 7d ff 00 fa",
]
table = Table(title="Can data")
table.add_column("Index", justify="right", style="red", no_wrap=True)
table.add_column("Id", style="yellow")
table.add_column("Values", justify="right", style="green")
pidvalues = {} # Last value for each ID
for index, msg in enumerate(canbus_data):
date, id, values = msg.split(": ")
if pidvalues.get(id, None) != values:
table.add_row(f"{index}", id, values)
pidvalues[id] = values
console.print(table)
Posts: 257
Threads: 108
Joined: May 2019
(Mar-20-2022, 12:27 PM)snippsat Wrote: Python has a big star✨ when comes to print color in console and that is Rich
korenron your index adding in last code don't work at all.
I use deanhystad code and add index there,then show i couple of ways with Rich.
from rich import print
from rich.console import Console
console = Console()
canbus_data = [
"2022-03-15 15:21:19.479516: 18FF20EF: ff 7d e4 04 7d ff 00 13",
"2022-03-15 15:21:19.484668: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.485292: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.486379: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.489523: 18FF20EF: ff 7d e4 04 7d ff 00 11",
"2022-03-15 15:21:19.490570: 0CF101A7: 07 00 d9 08 00 00 b9 9e",
"2022-03-15 15:21:19.491136: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.491688: 18F120F0: 00 fa 19 30 13 6d 4f 4e",
"2022-03-15 15:21:19.492545: 0CF00300: fd 00 ff ff ff ff ff ff",
"2022-03-15 15:21:19.499572: 18FF20EF: ff 7d e4 04 7d ff 00 22",
"2022-03-15 15:21:19.509498: 18FF20EF: ff 7d e0 04 7d ff 00 99",
"2022-03-15 15:21:19.510157: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.510678: 0CF101A7: 07 00 d2 08 00 00 b9 9f",
"2022-03-15 15:21:19.511279: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.511836: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.512420: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.519575: 18FF20EF: ff 7d e4 04 7d ff 00 fa",
]
pidvalues = {} # Last value for each ID
for index, msg in enumerate(canbus_data):
date, id, values = msg.split(": ")
if pidvalues.get(id, None) != values:
console.print(f"{index} [bold green]{id}[/]: [bold red]{values}[/]")
pidvalues[id] = values
Want a Table format in console Rich can to that to.
from rich.console import Console
from rich.table import Table
console = Console()
canbus_data = [
"2022-03-15 15:21:19.479516: 18FF20EF: ff 7d e4 04 7d ff 00 13",
"2022-03-15 15:21:19.484668: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.485292: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.486379: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.489523: 18FF20EF: ff 7d e4 04 7d ff 00 11",
"2022-03-15 15:21:19.490570: 0CF101A7: 07 00 d9 08 00 00 b9 9e",
"2022-03-15 15:21:19.491136: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.491688: 18F120F0: 00 fa 19 30 13 6d 4f 4e",
"2022-03-15 15:21:19.492545: 0CF00300: fd 00 ff ff ff ff ff ff",
"2022-03-15 15:21:19.499572: 18FF20EF: ff 7d e4 04 7d ff 00 22",
"2022-03-15 15:21:19.509498: 18FF20EF: ff 7d e0 04 7d ff 00 99",
"2022-03-15 15:21:19.510157: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.510678: 0CF101A7: 07 00 d2 08 00 00 b9 9f",
"2022-03-15 15:21:19.511279: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.511836: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.512420: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.519575: 18FF20EF: ff 7d e4 04 7d ff 00 fa",
]
table = Table(title="Can data")
table.add_column("Index", justify="right", style="red", no_wrap=True)
table.add_column("Id", style="yellow")
table.add_column("Values", justify="right", style="green")
pidvalues = {} # Last value for each ID
for index, msg in enumerate(canbus_data):
date, id, values = msg.split(": ")
if pidvalues.get(id, None) != values:
table.add_row(f"{index}", id, values)
pidvalues[id] = values
console.print(table)
very nice - I didn;'t know about it
but my main quesion is - how can I print only the changes in te string , an not all of it in color
can it also be done using "Rich" ?
Posts: 7,137
Threads: 122
Joined: Sep 2016
(Mar-20-2022, 12:56 PM)korenron Wrote: but my main quesion is - how can I print only the changes in te string , an not all of it in color
can it also be done using "Rich" ? Yes you can give color to lines or single variables variables.
Just to give example with eg lines color change.
from rich import print
from rich.console import Console
console = Console()
canbus_data = [
"2022-03-15 15:21:19.479516: 18FF20EF: ff 7d e4 04 7d ff 00 13",
"2022-03-15 15:21:19.484668: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.485292: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.486379: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.489523: 18FF20EF: ff 7d e4 04 7d ff 00 11",
"2022-03-15 15:21:19.490570: 0CF101A7: 07 00 d9 08 00 00 b9 9e",
"2022-03-15 15:21:19.491136: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.491688: 18F120F0: 00 fa 19 30 13 6d 4f 4e",
"2022-03-15 15:21:19.492545: 0CF00300: fd 00 ff ff ff ff ff ff",
"2022-03-15 15:21:19.499572: 18FF20EF: ff 7d e4 04 7d ff 00 22",
"2022-03-15 15:21:19.509498: 18FF20EF: ff 7d e0 04 7d ff 00 99",
"2022-03-15 15:21:19.510157: 00FF012F: 00 7d 00 7d 00 7d ff ff",
"2022-03-15 15:21:19.510678: 0CF101A7: 07 00 d2 08 00 00 b9 9f",
"2022-03-15 15:21:19.511279: 00FF022F: ff ff ff ff ff ff ff ff",
"2022-03-15 15:21:19.511836: 0CFE6CEE: 4b ff ff c4 00 fe e6 08",
"2022-03-15 15:21:19.512420: 00FF032F: 00 20 00 00 3f ff c0 80",
"2022-03-15 15:21:19.519575: 18FF20EF: ff 7d e4 04 7d ff 00 fa",
]
pidvalues = {} # Last value for each ID
for index, msg in enumerate(canbus_data):
date, id, values = msg.split(": ")
if pidvalues.get(id, None) != values:
if '07' in values:
console.print(f"{index} [bold green]{id}[/]: [bold red]{values}[/]")
else:
console.print(f"{index} [bold green]{id}[/]: [bold blue]{values}[/]")
pidvalues[id] = values
|