Created
May 17, 2011 15:31
-
-
Save ttreitlinger/976700 to your computer and use it in GitHub Desktop.
executing netcat from a python script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
test_cmd = 'netcat -vz 193.1.172.59 75-85' | |
expected = 'vega.ucd.ie [193.1.172.59] 80 (http) open' | |
process = subprocess.Popen(test_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
err = process.stderr.read() | |
print str(err) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was having an issue with netcat and subprocess. This helped me tremendously!