What’s the functionality of the dry-run option in the optparse module of Python?
What’s the functionality of the dry-run option in the optparse module of Python?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Dry run is a generic expression in many fields, including computing, meaning that a certain operation should be performed or simulated limiting its dangerous effects.
It is up to you to associate that option to something meaningful in your code. For example: if your script normally removes files from the hard drive, the
--dry-runoption should only print out a list of the files that would have been deleted if the script would have been ran without the--dry-runoption.--dry-runis just a conventional name for that option, but you could implement the same functionality with any other name (e.g--simulate-onlyor--dont-screw-up).