Dears I was planning to extract my Subnet mask, I had used the below code but the subnetmask is always 255.255.255.255 which is wrong
import socket
There are alternatives to netifaces on Windows. You can retrieve the interface information using wmic. wmic has a machine readable output option using XML:
netifaces
Windows
wmic
wmic nic get /format:rawxml
A python example to parse this output is available.