Ask Your Question
1

Running several commands from command line

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

RegularUser gravatar image

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

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
3

answered 2018-06-12 18:14:17 +0100

Sébastien gravatar image

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

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

Stats

Asked: 2018-06-12 16:13:50 +0100

Seen: 512 times

Last updated: Jun 12 '18