Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Let's say I have a script that needs the user to set X number of variables at the start. One can either Pass the arguments in on the command line. Start the program and then have the user input...
#2: Post edited
For scripting what are the pros and cons of command line arguments versus capturing input at the start?
Let's say I have a script that needs the user to set X number of variables at the start. One can either - Pass the arguments in on the command line. - Start the program and then have the user input the variables with Python's ```input()``` function or PHP's ```fopen("php://stdin", "r")``` for example. What would the pros and cons be and when would I decide to use one method versus the other?
#1: Initial revision
For scripting what are the pros and cons of command line arguments versus capturing input at the start?
Let's say I have a script that needs the user to set X number of variables at the start. One can either - Pass the arguments in on the command line. - Start the program and then have the user input the variables with Python's ```input()``` function or PHP's ```fopen("php://stdin", "r")``` for example. What would the pros and cons be and when would I decide to use one method versus the other?