Ask Your Question

Running several commands from command line

asked 2018-06-12 09:13:50 -0500

RegularUser gravatar image

updated 2018-06-12 09:14:06 -0500

You can make Sage evaluate a given Python expression by running sage -c <your-command> from command line. However, it seems that the -c parameter can only be given once. How do I make sage evaluate several commands in succession then?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2018-06-12 11:14:17 -0500

Sébastien gravatar image

updated 2018-06-12 11:45:17 -0500

One way is to concatenate the commands with a ; in between:

$ sage -c "m=matrix(2,2,range(4));print(m^10)"
[ 44726  79647]
[159294 283667]
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

1 follower


Asked: 2018-06-12 09:13:50 -0500

Seen: 36 times

Last updated: Jun 12