I am using python 2.7 on Windows 10. Here is a snippet of my code :-
import dns
myresolver = dns.resolver
xyz = myresolver.query(record, "SRV")
for rdata in xyz.response.answer:
z = str(rdata)
print ("after string " + z)
list = z.split()
type = "SRV"
hostName = list[7]
I am querying the dns server to get the SRV records. I get rdata as RRset values. My aim is to get hostName and use it further in my code. I get hostName as a string when I run my python program on the IDE but peculiarly this is not so when I convert the same python file into an exe file using py2exe.I am getting the output of the dns.resolver.query as HEX in the exe file. My ultimate goal is to have this script run as an exe file.