Ask Your Question

Riccardo's profile - activity

2023-05-13 21:34:10 +0200 received badge  Notable Question (source)
2023-05-13 21:34:10 +0200 received badge  Popular Question (source)
2018-12-19 11:18:15 +0200 received badge  Student (source)
2018-12-19 11:15:21 +0200 asked a question How to create a "sage program" with command line input

I am completely new to Sage and Pyhton, so this is probably a very trivial question, but I am not able to find any answer. I have a file script.sage

N=10
sage_command1
sage_command2
sage_command3
print(result)

I use this script via sage script.sage and it does what I want. How can I modify this so that I can pass the variable N in the command line? Something like sage script.sage 10 and then it prints the result.

Thank you!