A background Python process sits in memory with a persistent namespace. You write .py files with #%% cell blocks, then execute cells by reference. No ports, no sockets, no dependencies.
An exemplar python implementation of the Bag of (Visual) Words and Histogram of Oriented Gradient (HOG) feature based object detection (BoW or HOG features, SVM classification) using OpenCV. Examples ...