Python Forum
f-string in command line arguments - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: f-string in command line arguments (/thread-26573.html)



f-string in command line arguments - Skaperen - May-05-2020

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.