title: Calling a C++ Function that returns list
body: <p>I have this function is C++:</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;iphlpapi.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;iostream&gt;
  
  
  #pragma comment(lib, "iphlpapi.lib")
  void printInterfaces(){
  
      ULONG buflen = sizeof(IP_ADAPTER_INFO);
      IP_ADAPTER_INFO *pAdapterInfo = (IP_ADAPTER_INFO *)malloc(buflen);
  
      if (GetAdaptersInfo(pAdapterInfo, &amp;buflen) == ERROR_BUFFER_OVERFLOW) {
          free(pAdapterInfo);
          pAdapterInfo = (IP_ADAPTER_INFO *)malloc(buflen);
      }
  
      if (GetAdaptersInfo(pAdapterInfo, &amp;buflen) == NO_ERROR) {
          for (IP_ADAPTER_INFO *pAdapter = pAdapterInfo; pAdapter; pAdapter = pAdapter-&gt;Next) {
  
              if (pAdapter -&gt; IpAddressList.IpAddress.String != "0.0.0.0"){
                  std::cout &lt;&lt; "IP: " &lt;&lt;
                      pAdapter-&gt;IpAddressList.IpAddress.String &lt;&lt;
                      " Description: " &lt;&lt;
                      pAdapter-&gt; Description &lt;&lt; std::endl;
  
              }
  
  
          }
      }
  
      if (pAdapterInfo) free(pAdapterInfo);
  
  }
  </code></pre>
  
  <p>I am writing a sniffer with python and I want to get the names of interfaces on windows, so this c++ code prints the IP address and the Description, Is there a way to call this function from python and to make it return the interfaces as a list with tuples? and also I have a problem there when doing <code>!= "0.0.0.0"</code> it runs but doesn't filter the interfaces with ip "0.0.0.0". what is the correct way to do it? Also I am more familiar with C#, Is importing C# is easier then C++?</p>