So i have this application thats rather complicated…
To keep it short this is the main things you should know:
file_name = raw_input("Name your file:").lower()
os.popen(sudo tcpdump -c5 -vvv -w "file_name" host wiki or host wiki2)
but this doesn’t seem to work. Can i get a fix?
Thanks,
Pastelinux
edit1:
Alright this is what i have now, but its not working, any pointers on how to fix?
import subprocess, os, sys
filename = raw_input('File name:').lower
pipe = os.popen("sudo tcpdump -c5 -w", 'filename')
pipe = popen("sudo tcpdump -c5 -w", shell=True, stdout=PIPE).stdout
Don’t use `os.popen’, you should use the subprocess module.
I am assuming this (a string):
is your command.
Since we just need to call tcpdump and not get any output from it, we use subprocess.call
Of course why it is not working depends on what the error is, but this is how you should go about it. If you can update the answer with your error, then it can be clear.