Parsing and Fetching DNS Resolvers in /etc/resolv.conf Using Python

In an app development I needed to use my system resolvers which is different from my ISP default resolver, and Python keeps taking my ISP resolver. I decided to put up this simple function to get resolvers for me in /etc/resolv.conf, here is it:

I hope this helps