Ask Your Question
1

how to sage a .sage file

asked 2018-03-15 12:27:18 -0600

kate_l196 gravatar image

updated 2019-08-26 14:16:10 -0600

FrédéricC gravatar image

I am having sage installed on a windows 10. Sage file example.sage.sage which is generated by sagetex is situated in K:\sageexample folder. How to run sage on this file. All references are full of jargonism and don't explain anything at all or give examples. I run sage shell and prompt: run ('K:sageexample\example.sage.sage') but no result. I run load command load ('K:sageexample\example.sage.sage') no example. I don't want to install linux for one program. How to "sage" a file from notebook interface?

edit retag flag offensive close merge delete

Comments

1

How did you install Sage ? On Windows, there are currently two possibilities :

  • installing the Sage virtual appliance (= a Linux virtual machine) and running it in Virtualbox.

  • Installing Erik Bray's installer (which creates a minimal Cygwin tree).

Both of these are mainly oriented to the interactive use of Sage from either a Jupyter worksheet or a "Sage console". Running Sage from the command line to compile example.sagetex.sage is a third (marginal) case, for which you need to be at a terminal :

  • A Linux terminal in the first case

  • A Cygwin terminal in the second case.

So tell us how you did install Sage...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2018-03-17 04:27:13 -0600 )edit

3 answers

Sort by » oldest newest most voted
4

answered 2018-03-27 04:17:25 -0600

Iguananaut gravatar image

updated 2018-03-27 04:18:07 -0600

Assuming that you installed the Windows native version of Sage, run the "SageMath Shell" which opens a command-prompt, and run

sage 'K:\sageexample\example.sage.sage'

at the prompt (for example, based on the filename in the question). Note that this a a bash (Unix-like) shell, where the backslashes used in Windows paths imply an escape character normally, which might have been your problem. So it's necessary to enclose the path in single-quotes for it to be interpreted correctly.

Alternatively you can use forwardslashes instead of backslashes like

sage K:/sageexample/example.sage.sage

This will be interpreted correctly as a Windows path as long at it starts with a valid drive letter.

edit flag offensive delete link more
0

answered 2019-09-28 16:17:47 -0600

I was overjoyed to find that, on my Windows 10 PC, the sagemath 8.8 "shell" produced an ASCII terminal window.

The window understands vi (although the existent .exrc file has no effect).

And, from within a vi session, SEEMS to understand "!sage %" to run the current file.

Only thing: where's the sage-run output go?

edit flag offensive delete link more
0

answered 2019-03-22 16:53:46 -0600

On windows, open Sagemath shell and navigate to the folder where your file is placed. You should use "cd" command. Be carefull with folders with spaces. In that case write folder name between ' '

tu process the file you should write load('file.sage') (file is the name of your file)

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2018-03-15 12:27:18 -0600

Seen: 530 times

Last updated: Mar 27 '18