John Kitchin is so busy turning out little Emacs jewels it’s a wonder he has any time to do Chemical Engineering. Of course, most of those jewels are in the service of solving problems with his research and his latest is no different. The problem is he has some long running Python is an Org file and would like to continue his work in the file while it’s running.
He has a post and a video that detail his solutions. That’s plural because he provides three ways of doing it. The first two involve tangling the source out to a temporary file, calling Python, and capturing the result. His final and preferred method avoids the tangling to a temporary file and lets you see the results as they are generated instead of all at once at the end.
You may or may not have a need for asynchronous Babel code but like all of Kitchin’s work, you’re sure to learn a bit from seeing how he approaches and solves the problem. The video is just short of 9 minutes so it should be easy to schedule. I recommend watching the video first and then using the post to study the code at a more leisurely pace.