0

So I am new to python. I need to use the dig command on my windows machine with this command:

dig +short TXT e462dbee005c11294a39ed8d2e466516.malware.hash.cymru.com

I am having trouble passing this command into the subprocess check output. I think it may have to do with the way I am placing the arguments into the check output? The command needs to be like this for the output that I would get so changing the command wont be a fix.

Also, since I am on windows I had to acquire dig from the BIND suite and add it to my path, would this also affect how the python script runs the command?

import subprocess
output = subprocess.check_output(['dig', '+short', 'TXT', 'e462dbee005c11294a39ed8d2e466516.malware.hash.cymru.com'])
print(output)
Dallas Phillips
  • 371
  • 2
  • 15
  • What output do you get? –  May 05 '16 at 20:31
  • "and add it to my path, would this also affect how the python script runs the command?" That is not unlikely. Just specify the full path to dig as the executable/first element of the array, and see how you go. –  May 05 '16 at 20:32
  • 1
    what specific error do you get? What do you expect to happen? What happens instead, describe step by step. Unrelated: why don't you [use `nslookup` on Windows](http://superuser.com/a/722397/13868)? – jfs May 05 '16 at 20:55

0 Answers0