No, this is not currently possible due to how Jupyter is managing the output.
The same issue effects running shell scripts in Jupyter. Many tickets have been raise on it .e.g https://discourse.jupyter.org/t/how-to-show-the-result-of-shell-instantly/8947