I'm trying to get tshark running through a python script and get a traceback [and I'm using ptyhon 3.9]
This is the python script which I'm using:
import subprocess
from pythonosc import osc_message_builder, udp_client # python 3.3.x+
osc = udp_client.UDPClient('localhost', 8000)
popen = subprocess.Popen(['tshark', '-l'], stdout=subprocess.PIPE)
for traffic in iter(popen.stdout.readline, ''):
traffic = traffic.decode('utf-8').strip()
#print(traffic)
msg = osc_message_builder.OscMessageBuilder(address='/tsharky')
msg.add_arg(traffic, 's')
msg = msg.build()
osc.send(msg)
This is the traceback that I get:
Traceback (most recent call last):
File "/Users/trem/Downloads/tsharky-master/tsharky.py", line 18, in <module>
popen = subprocess.Popen(['tshark', '-l'], stdout=subprocess.PIPE)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'tshark'
Where should this directory be and how can I get this code running?