Ask Your Question

load('foo.sage') - Is it possible to display inputs and ouputs to the console?

asked 2018-06-30 06:13:52 -0500

sageuser1732 gravatar image

updated 2018-06-30 06:31:41 -0500

The load command appears to operate "silently", except for commands that explicitly output to the console (such as print commands).

Is there a way to have inputs and outputs of the commands in the file being loaded to be displayed to the console as if they were entered interactively?

I'm running a console version of Sage 8.1 (binary install) in Windows 7.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-06-30 10:00:37 -0500

tmonteil gravatar image

You can use th ipython magic %load:

sage: %load foo.sage
edit flag offensive delete link more


I tried it, but it doesn't do what I was hoping for. Here are the issues . . .

(1) %load requires a string constant as a filename, but my actual filename is stored in a variable.

(2) The inputs are shown as a batch, but not executed until I interactively force the execution. I was hoping to for there to be a way for the load of the sage file to mimic an interactive session, with inputs followed by outputs, one command at a time.

Perhaps it's not possible?

sageuser1732 gravatar imagesageuser1732 ( 2018-06-30 11:51:59 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2018-06-30 06:13:52 -0500

Seen: 42 times

Last updated: Jun 30