How is it possible to convert a script accepting a command-line argument to be able to receive the argument through standard user input?
Currently I have a file and to process it I need to run python abc.py query
whereas I would like the file to be able to run through python abc.py and then in the next line it should ask the user for input through raw_input and the response should be passed to argument (i.e. ‘query’).
There is no way to make this happen without changing
abc.pyitself.If you can change
abc.pythen a good way is to have it check for the command-line argument, and if it’s not there then ask for it… something like this: