Reputation: 443
When I use the check_output within the Subprocess module I have this output error from the Python shell:
AttributeError: 'module' object has no attribute 'check_output'
The code:
target = raw_input("IP: ")
port = subprocess.check_output(["python", "portscanner.py", target ])
I use Python 2.7. Thanks for the solution!
Upvotes: 3
Views: 1132
Reputation: 947
check_output() method is defined in python2.7 onwards, as said by "Martijn Pieters"
check in subprocess.py line no: 515
def check_output(*popenargs, **kwargs):
you may either be using the old python version or you might have messed up with the python interpreter.
try using
dir(module[.class])
to find the available methods or classes in any module and proceed.
Upvotes: 1