There are many ways to add stuff to the mode line.
One way is to define a global minor-mode and a global string variable, register the variable in mode-line-format when the minor mode is active.
Run your Python code with a timer and write the result to the string variable and call force-mode-line-update for all windows afterwards.
The following Elisp code ...
You want to append data to global-mode-string 1.
(add-to-list 'global-mode-string '(:eval (myfunc)))
(defun myfunc ()
(setq mystring (shell-command-to-string "myshellcommand")))
where myshellcommand is your python script invocation returning your data string.
Now this might stress the system, so instead
(run-at-time 0 60 'myfunc)
What Dan said is true. The Modeline is already very populated and showing the outline path there overfloods it. Alternatively you could also use the header line:
(defvar-local org+-header-line-format nil
"Cons with position of last synchronization of outline path
and the header line string.")
(defun org+-list-mapconcat (fun list separator)