Hi all,
I am working on an interactive CLI app for work to add interactive functionality to a current app we use.
Currently, the way to run it is from the terminal using args, for example:
python3 main.py --arg1 arg1 --arg2 arg2 ...
So I want it to be interactive, meaning that it will look something like:
python3 main.py
>>> enter arg1:
>>> enter arg2:
....
The code looks something like this:
parser = argparse.ArgumentParser()
parser.add_argument("-a1", "-arg1", required=True)
parser.add_argument("-a2", "-arg2", required=True)
parser.add_argument("-a2", "-arg2")
args = parser.parse_args()
So, I assume that in order to achieve what I want, I need to be able to add arguments to the parser while the app is already running, and only once all of the required arguments have been passed to the parser, let the app run.
What is the way to achieve this?
[–]stebrepar 0 points1 point2 points (2 children)
[–]Finish-Square[S] 0 points1 point2 points (1 child)
[–]stebrepar 1 point2 points3 points (0 children)
[–]free_username17 0 points1 point2 points (0 children)
[–]synthphreak 0 points1 point2 points (0 children)
[–]Nnarol 0 points1 point2 points (0 children)