Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incremental Output #67

Closed
ben-denham opened this issue Apr 21, 2018 · 2 comments
Closed

Incremental Output #67

ben-denham opened this issue Apr 21, 2018 · 2 comments

Comments

@ben-denham
Copy link

Is there currently a way to incrementally update a cell's output? E.g. to provide a progress bar for some long-running background thread?

The closest I've come so far is the following snippet, which immediately prints "Let the above loop run in the background", but any calls to display after the cell has finished its initial output seem to be buffered until the next time the cell is executed:

(require '[clojupyter.misc.display :refer [display]])
(future
    (doseq [i (range 10)]
        (Thread/sleep (* i 100))
        (display (str "Completed " i))))
(println "Let the above loop run in the background")

Also, thanks for the super useful kernel!

@luojieshun
Copy link
Collaborator

luojieshun commented Apr 21, 2018 via email

@klausharbo
Copy link
Collaborator

It is indeed possible to incrementally update a cell, as in

(doseq [i (range 10)]
    (println i)
    (Thread/sleep 500))
:ok

which will print numbers 0-9 and finally return :ok as the result of evaluation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants