First time here? Check out the FAQ!

Ask Your Question
0

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

asked 6 years ago

sageuser1732 gravatar image

updated 6 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 6 years ago

tmonteil gravatar image

You can use th ipython magic %load:

sage: %load foo.sage
Preview: (hide)
link

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 ( 6 years ago )

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: 6 years ago

Seen: 217 times

Last updated: Jun 30 '18