Ask Your Question

Running several commands from command line

asked 2018-06-12 16:13:50 +0200

RegularUser gravatar image

updated 2018-06-12 16:14:06 +0200

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 18:14:17 +0200

Sébastien gravatar image

updated 2018-06-12 18:45:17 +0200

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 16:13:50 +0200

Seen: 468 times

Last updated: Jun 12 '18