I have a problem...
import sys
import subprocess
subprocess.call(['traceroute -I www.yahoo.com'])
and I had try
import sys
import subprocess
subprocess.call(['/usr/sbin/traceroute -I www.yahoo.com'])
why I am recieving the following error message: "OSError: [Errno 2] No such file or directory". Can anyone help...thanks!
I hate to answer without knowing the much about the underlying reasons, but I've run into this before with subprocess. The call arguments list really wants a list -- I assume it is looking for an executable with spaces in the name, exactly matching what you enter. Try this instead:
import subprocess
subprocess.call(['traceroute', 'www.yahoo.com'])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With