title: How to get local ip address python?
body: <p>There's a code I found in internet that says it gives my machines local network IP address:</p>
  <pre><code>hostname = socket.gethostname()
  local_ip = socket.gethostbyname(hostname)
  </code></pre>
  <p>but the IP it returns is 192.168.94.2 but my IP address in WIFI network is actually 192.168.1.107
  How can I only get wifi network local IP address with only python?
  I want it to work for windows,linux and macos.</p>