Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To add to Emmanuel's answer, in addition to inspecting sys.argv directly, you can easily implement clean and well-documented command line argument handling with argparse (it takes a little getting used to, but the examples at the top of the documentation contain most of what you need to know to get started).

Keep in mind that "Sage" code, including .sage scripts, is just the Python programming language with a few specialized bells and whistles, so any question you might have about how to do X with Sage, that isn't explicitly mathematics-related, is a question you can also ask about how to do that in Python and hence find myriad existing resources.