Ask Your Question

Revision history [back]

Running Sage in command-line

I know how to run a sage function in command-line:

[liuzw@ln01 ~]$ sage -c 'print(1+1)'
2
[liuzw@ln01 ~]

I know how to attach a code in command-line:

[liuzw@ln01 ~]$ sage fusion2.spyx
Compiling fusion2.spyx...
[liuzw@ln01 ~]$

But I don't know how to run a sage function after having attached a code:

[liuzw@ln01 ~]$ sage fusion2.spyx -c 'print(1+1)'
Compiling fusion2.spyx...
[liuzw@ln01 ~]$

Question: How to do this last step?

Running Sage in command-line

I know how to run a sage function in command-line:

[liuzw@ln01 ~]$ sage -c 'print(1+1)'
2
[liuzw@ln01 ~]

I know how to attach a code in command-line:

[liuzw@ln01 ~]$ sage fusion2.spyx
Compiling fusion2.spyx...
[liuzw@ln01 ~]$

But I don't know how to run a sage function after having attached a code:

[liuzw@ln01 ~]$ sage fusion2.spyx -c 'print(1+1)'
Compiling fusion2.spyx...
[liuzw@ln01 ~]$

Of course here print(1+1) is a trivial function to show an easy example.
Usually I need to use a function defined in the file fusion2.spyx.

Question: How to do this last step?