How to get the ip of gateway v4, mac

Please also paste the output of the python code. Here’s an another python example