Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Showing data change
#5
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),
Reply


Messages In This Thread
Showing data change - by korenron - Mar-15-2022, 02:13 PM
RE: Showing data change - by deanhystad - Mar-15-2022, 02:41 PM
RE: Showing data change - by korenron - Mar-15-2022, 06:02 PM
RE: Showing data change - by deanhystad - Mar-15-2022, 06:39 PM
RE: Showing data change - by korenron - Mar-20-2022, 09:31 AM
RE: Showing data change - by korenron - Mar-20-2022, 10:18 AM
RE: Showing data change - by deanhystad - Mar-20-2022, 12:04 PM
RE: Showing data change - by snippsat - Mar-20-2022, 12:27 PM
RE: Showing data change - by korenron - Mar-20-2022, 12:56 PM
RE: Showing data change - by snippsat - Mar-20-2022, 01:15 PM
RE: Showing data change - by korenron - Mar-20-2022, 01:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with writing monitored data to mysql upon change of one particular variable donottrackmymetadata 3 435 Apr-18-2024, 09:55 PM
Last Post: deanhystad
  Showing an empty chart, then input data via function kgall89 0 1,037 Jun-02-2022, 01:53 AM
Last Post: kgall89
  Same Data Showing Several Times With Beautifulsoup Query eddywinch82 2 1,329 May-29-2022, 11:46 PM
Last Post: eddywinch82
Question Change elements of array based on position of input data Cola_Reb 6 2,256 May-13-2022, 12:57 PM
Last Post: Cola_Reb
  Extracting data without showing dtype, name etc. tgottsc1 3 4,741 Jan-10-2021, 02:15 PM
Last Post: buran
  Change of mass hexa data kosteloos 0 1,817 Aug-12-2019, 10:04 AM
Last Post: kosteloos
  change source from csv data to gsheet Tummerke 1 2,150 May-21-2019, 05:16 AM
Last Post: heiner55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020