How to use argv with Spyder

Solution 1:

To pass argv to a script in Spyder, you need to go the menu entry

Run > Configuration per file

or press the Ctrl+F6 key, then look for the option called

Command line options

on the dialog that appears after that, and finally enter the command line arguments you want to pass to the script, which in this case could be

one two three

Solution 2:

In addition to configuring in the Run->Configure as explained in other answers, you can use "runfile" directly from the console.

Run the following:

   runfile('ex13.py', args='first second third')

Solution 3:

In Spyder, go Run > Configure and define your argv values as showing in following diagram and to run the script just press F6

diagram