I've seen different softwares using compiled programs as a "module"; an example would be wifite which uses the aircrack suite.
Similarly, I need to implement tshark inside my python program but without having to work my way through the source code (mainly because I'd want the software to be modular and to leave tshark as a simple dependency).
What's the best way to do so? I'd avoid a simple call to the program as I don't feel it is very pythonic.
In a general sense, the generic API provided by standard UNIX programs consists of:
subprocess
module).Traditionally, UNIX programs communicate with each other via these means -- reading input from stdin (unless otherwise specified on command line), writing to stdout, logging to stderr, etc.
Some programs may offer library interfaces, or socket-based interfaces, but these are available only on a case-by-case basis.
If you are trying to interface with software written in C that provides a library interface, see the ctypes
standard-library module.