Issue
I have a Jupyter notebook (.ipynb
) with the following content:
%%bash
python log_test.py
which log_test.py
is:
import time
print('this is first appearance...')
time.sleep(10)
print('after 10 sec sleep')
time.sleep(10)
print('after 10 sec sleep')
When I execute the jupyter cell it doesn't show the output directly after print()
function and waits until the job is completely done. I would like to know is it possible to do it in some way to show the output immediately (without waiting 20 sec)?
Solution
So I followed this website
therefore I replaced the code
%%bash
python log_test.py
with this line:
%run -i log_test.py
It printed out in real time.
Answered By - SirBaum
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.