Hello Andrey
neither of them works.
As I read here
<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script>, 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 to the bytecode, as you mention, it does not make sense.
I'll try to use the makeSagecell callback attribute to load the program.
AJAX style :-)
If it works I will post it here
Thanks again,
George
El jueves, 5 de octubre de 2017, 22:56:45 (UTC-4), Andrey Novoseltsev
escribió:
>
> 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 uses standard Python means of loading files/code, but that relies on
> having your code hosted somewhere with a stable IP or DNS name.
>
>
> On Tuesday, 3 October 2017 18:58:59 UTC-6, Jorge Manrique wrote:
>>
>> Hello everyone,
>> I have an interactive program in Python. The program does some
>> calculations with SageMath and graphs the results. The code is a bit long.
>> I want to embed the program on a webpage using SageCell and I wonder if I
>> can leave the Python program on the web server and use an external script:
>>
>> <head>
>> . . . . . . .
>> <script>
>> sagecell.makeSagecell ({
>> inputLocation: '#plot'
>> })
>> </ script>
>> </ head>
>> . . . . . . .
>> <div id = "plot">
>> <script type = "text / x-sage" src = "/ src / somegraph.py"> </ script>
>> </ div>
>>
>> or compile the program, for example, with CPython, and then include the
>> bytecode in the second script above:
>>
>> <div id = "plot">
>> <script type = "application / octet-stream">
>> bytecode
>> </ script>
>> </ div>
>>
>> Any suggestions will be appreciated,
>> Jorge
>>
>>
--
You received this message because you are subscribed to the Google Groups
"sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-cell/382954d4-c970-41b4-85eb-50e33058c0a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.