Python Forum

Full Version: f-string in command line arguments
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am starting the design of a command i have previously written in C now to be in Python3. this command takes input from stdin and executes a command given in the command line arguments with a certain character being substituted with a line from stdin, repeating for each line in stdin. but, i want to make some changes in the new Python3 version. to start with, i want to support the use of f-strings on the given command argument. what i am wondering is how i might do that. the code will be getting an ordinary string from sys.argv and will need to handle it like it were an f-string. i have not even started the design, yet, or even the code. any suggestions on the direction to go with the f-strings part?

i left out part of the description of the command. it uses one special argument ... the maximum number of parallel processes running commands. if that number is 1 then, obviously, it just does one at a time. if a number less than 1 is given, it outputs the commands it would have run, in the order given.