Command-line arguments


In the python interpreter on the website, how do you pass command-line arguments to the program? This feature seems to be missing, though I don’t see how the interpreter can really be useful otherwise.


Hi @byronhawkins61518803,

Codecademy’s Python interpreter is intended only for use in the courses. If you need command line options, you should run a Python interpreter locally on your computer.


I don’t need command line options, but I do need to teach about programming with user input, which for python comes in the form of command line arguments. For example, if we make a script to add numbers, then we need to test the script like this:

python 1 2 3 4
> says "the sum (1 + 2 + 3 + 4) = 10"

Is this not possible in an online course hosted on codecadamy?


For your own own projects, i would never consider using the codecademy editor and python interpreter, they can’t be tweaked as much. And they are slower given code has to be send back and forth between your computer and codecademy server

Setting up your own developing environment is the way to go!


If you want to teach stuff outside of CC, you’ll need to find other tools for now. You might be able to do that someday, but I’d still recommend using your local environment for the reasons @stetim94 mentioned.