Hi Jupyter folks

I am puzzled by the behaviour in this case:

Cell 1
import IPython
javascript = """
    var url = window.location;

        var command = "url" + " = '" + url + "'";

        var kernel = IPython.notebook.kernel;

        
        kernel.execute(command) ;
"""
IPython.display.display(IPython.display.Javascript(javascript))



Cell 2
print(url)


If I run cell 1, then run cell 2, by hand, one after the other, then all is 
fine: the url is printed.  If i 'run all' then the "name 'url' is not 
defined" (this is the case if i rerun cell 2, after having run all)

It's like that kernel.execute is being trampled on by the print and the url 
variable is never properly assigned.

I've tried time.sleep and other work around steps but to no avail, if i run 
all, then the kernel.execute doesn't make a result.  Any python code 
following cell 1 seems to trigger this problem

any advice on how to deal with this would be very gratefully received
cheers
mark

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/473bf13c-13a9-46cc-8ed1-8f49170d3506%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to