Calling Sage on Windows from external scripts

57 zobrazení
Přeskočit na první nepřečtenou zprávu

Sean Fitzpatrick

nepřečteno,
2. 12. 2023 18:30:0502.12.23
komu: sage-support
I am wondering if anyone has experience installing Sage on Windows via WSL, and calling Sage as an executable from another program that's installed locally on Windows.

My particular use case is processing Sage plot images in a PreTeXt document.

I could install everything for PreTeXt via WSL but I already have most things locally installed: LaTeX, Python, VScode, etc.
Sage is the only missing piece.

For a PreTeXt book with Sage graphics, there's a Python script that extracts the Sage code, sends it to the Sage exectuable, and saves the resulting image.

I'm not sure how to have a Python script running locally on Windows call an executable in WSL.

David Ayotte

nepřečteno,
3. 12. 2023 2:58:3803.12.23
komu: sage-support
If you have Python script running locally on Windows, you could call the sage script by doing something like:

    import os
    os.system('wsl sage your-sage-script.sage')

See this page:


for more about Windows-Linux interoperability.

David A.

Sean Fitzpatrick

nepřečteno,
3. 12. 2023 9:21:3303.12.23
komu: sage-s...@googlegroups.com
Thanks David.

It sounds like that will require some changes in PreTeXt itself.

I was experimenting because I got a new Windows computer at work, to know how well PreTeXt is currently supported on Windows.

I think the answer might be that everything works locally, as long as your book doesn't have Sage graphics.
If it does, PreTeXt needs to be installed inside WSL rather than locally. Then one can follow instructions to connect vscode with the WSL.

I had also tried using the older 9.3 Windows installer, but I couldn't get that to work either, and if Sage will be WSL only moving forward, it is probably not worth the effort to figure it out.

--
You received this message because you are subscribed to a topic in the Google Groups "sage-support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-support/Nol-n_kYRAw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/a4cf8723-1376-49a6-babe-3bc910423cb4n%40googlegroups.com.

Dima Pasechnik

nepřečteno,
3. 12. 2023 10:39:1703.12.23
komu: sage-s...@googlegroups.com
We are actually removing Cygwin support in Sage, so yes, going forward it will be WSL only.
Odpovědět všem
Odpověď autorovi
Přeposlat
0 nových zpráv