I’m newbie to Python. I’d like to code a script running on Linux.
To test if user enter all the script arguments:
- If user type: myscript =>
print "Usage: myscript [Dir] [Old] [New]" - If user type: myscript Dir =>
print "Please enter Old and New" - If user type: myscript Dir Old =>
print "Please enter New" - If user type all the required arguments, then execute the main().
How to code myscript?
Or you can use argparse. This will not do what you asked for in the question, but it will hopefully placate J.F. Sebastian.