I have two variables readARP and readFPING which will have a series of IP’s listed in them and I want to compare one to the other. After comparing them I would like to print out the difference if there is any.
readARP = scanProcess.read()
readFPING = fpingscanPocess.read()
>>> print readARP
192.168.1.1
192.168.1.100
192.168.1.1
>>> print readFPING
192.168.1.1
192.168.2.1
192.168.1.12
I want to compare both and then print 192.168.2.1 192.168.1.12 192.168.1.100 since they are unique to the two.
P.S. What is “readFPING” referred to as in python I have adapted the term variable
After I find out what is different how could I add the different to a variable.
Example: 192.168.1.2 isnt in readFPING but I then want to add it (Creating a master ip list)
As simple as it can get. You can use the set symmetric_difference to find the unique elements in both the input source.