I can't seem to figure out a straightforward way to make code that finds the number of items to format, asks the user for the arguments, and formats them into the original form.
A basic example of what I'm trying to do is as follows (user input starts after ">>> "):
>>> test.py
What is the form? >>> "{0} Zero {1} One"
What is the value for parameter 0? >>> "Hello"
What is the value for parameter 1? >>> "Goodbye"
The program would then use print(form.format()) to display the formatted inputs:
Hello Zero Goodbye One
However if the form had 3 arguments, it would ask for parameters 0, 1 and 2:
>>> test.py (same file)
What is the form? >>> "{0} Zero {1} One {2} Two"
What is the value for parameter 0? >>> "Hello"
What is the value for parameter 1? >>> "Goodbye"
What is the value for parameter 2? >>> "Hello_Again"
Hello Zero Goodbye One Hello_Again Two
This is the most basic application that I can think of that would use a variable amount of things to format. I have figured out how to make variables as I need them using vars() but as string.format() can't take in lists, tuples, or strings, I can't seem to make ".format()" adjust to the number of things there are to format.