Ask Your Question

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

asked 2018-06-30 13:13:52 +0200

sageuser1732 gravatar image

updated 2018-06-30 13:31:41 +0200

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 17:00:37 +0200

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 18:51:59 +0200 )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 13:13:52 +0200

Seen: 166 times

Last updated: Jun 30 '18