[sage-cell] Re: Python program in an external script

2017-10-18 Thread Jorge Manrique
Hello Andrey, I have not made any measurements of the runtime environment, so I can not objectively compare both approaches. I think if the overhead time of the XMLHttpRequest is insignificant in relation to the load time of the embedded python script and the script is used several times, this a

[sage-cell] Re: Python program in an external script

2017-10-17 Thread Andrey Novoseltsev
On Tuesday, 17 October 2017 18:56:14 UTC-6, Jorge Manrique wrote: > > Hello there > I found a solution: > Great! If the Python script, as in my case, is large it will take some time to load > But I can write it once and use it several times and in different places > Can you please elaborate on t

[sage-cell] Re: Python program in an external script

2017-10-17 Thread Jorge Manrique
Hello there I found a solution: sagecell.makeSagecell({ inputLocation: '#pyscript', template: sagecell.templates.minimal, }); .. ... The script:sagesrc.js: function getPyScr(s) { "use strict"; var xhr; x

[sage-cell] Re: Python program in an external script

2017-10-06 Thread Jorge Manrique
Hello Andrey neither of them works. As I read here , if the MIME type is text/x-sage then the src attribute is ignored and the code will be treated as an embedded data block that will not be processed by the browser. In relation

[sage-cell] Re: Python program in an external script

2017-10-05 Thread Andrey Novoseltsev
Have you tried these? I am quite sure that bytecode will not work since both JS and Python side of SageMathCell operate with clear text code. Loading files into script tags perhaps may work. What I know some people have done in the past was loading long code via some short code snippet that use