Ask Your Question

html processing delay

asked 2012-01-08 01:41:26 +0200

Eugene gravatar image

updated 2012-01-09 16:14:06 +0200


Could anyone please explain me why this code:

for i in range(7):
    html('<script>alert("Text %g");</script>' % i)

gives no alert messages before cell completely calculated? Is there any way to force immediate output processing?

Another example:

for x in range(10):

This code gives immediate output as latex-commands like:


and after cell calculation is done it shows the correct symbols instead of latex-commands.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-01-09 15:10:01 +0200

Mike Witt gravatar image

updated 2012-01-09 15:10:35 +0200

To give periodic reports about what my code is doing, I sometimes do something like this:

print('About to start something')
# The code that does the thing
print('Finished doing something'

The "flush" business makes the output actually happen, rather than getting queued up for later. I think this works in both the command line and the notebook (I mostly use the command line).

edit flag offensive delete link more


Thanks for reply! But the flush method is not something that works here. The problem is in processing output not printing it. See new example posted - there is output, but this is raw output, not processed by jsmath or browser itself.

Eugene gravatar imageEugene ( 2012-01-09 16:15:33 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-01-08 01:41:26 +0200

Seen: 436 times

Last updated: Jan 09 '12