Ask Your Question
0

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

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

sageuser1732 gravatar image

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

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
0

answered 2018-06-30 17:00:37 +0100

tmonteil gravatar image

You can use th ipython magic %load:

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

Comments

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 +0100 )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

Stats

Asked: 2018-06-30 13:13:52 +0100

Seen: 185 times

Last updated: Jun 30 '18