I would like to know if there is any script in either python or C, by which I can save the IP address of my raspberry pi to a text file every time it boots up. I need to send this IP address to another raspberry pi who's IP address is static. I application that I am designing prevents me from assigning a static IP to the ther raspberry pi's. I plan to use socket program to send the IP address between the PIs.
I am also open to other methods of doing this if there are any! Thanks in advance