DNS.RESOLVER.QUERY gives unexpected output in exe file of the same python script

241
March 27, 2017, at 4:32 PM

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.

READ ALSO
Min, Max, Mean Duration Time csv

Min, Max, Mean Duration Time csv

I'm trying to subtract two columns in a CSV to create a 3rd column "Duration" End-Time - Start_time

216
How can I rewrite code into a python class? [on hold]

How can I rewrite code into a python class? [on hold]

I took some python oop lessons, however I have written very little oop myselfI would appreciate if someone guides me to convert the following code into a python class

179
Console speed: PyCharm vs Spyder

Console speed: PyCharm vs Spyder

I have installed both PyCharm and Spyder (from Anaconda2)

476
My form with a ModelMultipleChoiceField is not saving data.

My form with a ModelMultipleChoiceField is not saving data.

In the admin panel, I can add Persons to my CompleteClass modelThere is a M2M relationship between CompleteClass and Person

211