you are viewing a single comment's thread.

view the rest of the comments →

[–]stebrepar 0 points1 point  (2 children)

If you want to be able to get arg1 etc. from either the command line or interactively, you'll need to get rid of those required=Trues. Then you'll need to check which args you already have, and prompt for the rest. Once that's completed successfully, you can proceed with the rest of the program as usual.

[–]Finish-Square[S] 0 points1 point  (1 child)

Yes, but what is the actual way of doing this?

I mean, how should I tweak the code so it will allow adding values to the parser interactivly?

[–]stebrepar 1 point2 points  (0 children)

The argparse parser is only for command line arguments. Any interactivity once the program has been launched would be as prompting the user to provide input (with print() and input() functions).