I have a multicast network that must constantly send data to all other users. This data will constantly change, so I do not want the programmer to deal with sending packets to users. Because of this, I am trying to figure out how I can refer to any object or variable in Python (I am new to Python), so it can be changed by the user and changes what is sent in multicast packages.
Here is an example of what I want:
>>> test = "test" >>> mdc = MulticastDataClient() >>> mdc.add(test)
Any help on how I can fix this would be greatly appreciated.
UPDATE:
I also tried this:
>>> test = [1, "test"] >>> mdc = MulticastDataClient() >>> mdc.add(test) >>> mdc.receive() {'192.168.1.10_1': 'test'} >>> test[1] = "change!" >>> mdc.receive() {'192.168.1.10_1': 'change!'}
It really worked. Nonetheless,
>>> val = "ftw!" >>> nextTest = [4, val] >>> mdc.add(nextTest) >>> mdc.receive() {'192.168.1.10_1': 'change!', '192.168.1.10_4': 'ftw!'} >>> val = "different." >>> mdc.receive() {'192.168.1.10_1': 'change!', '192.168.1.10_4': 'ftw!'}
This does not work. I need "ftw!" become "different." in this case. I use strings for testing, and I use objects from other languages ββfor strings. I will only edit the contents inside the object, so will this end the job?
source share