How to Write Perfect Python Command-line Interfaces — Learn by Example by Yannick Wolff

(139 views)

This article will show you how to make perfect Python command line interfaces, to improve your team productivity and comfort. As Python developers, we always use and write command-line interfaces. On my Data Science projects, for example, I run several scripts from command-line to train my models and to compute the accuracy of my algorithms. This is why a good way to improve your productivity is to make your scripts as handy and straightforward as possible, especially when you are several developers working on the same project. In order to achieve that, I advise you to respect 4 guidelines: You should provide default arguments values when possible All error cases should be handled (ex: a missing argument, a wrong type, a file not found) All arguments and options have to be documented A progress bar should be printed for not instantaneous tasks Let’s take a simple example Let’s try to apply....

April 3, 2019
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
© HAKIN9 MEDIA SP. Z O.O. SP. K. 2023
What certifications or qualifications do you hold?
Max. file size: 150 MB.
What level of experience should the ideal candidate have?
What certifications or qualifications are preferred?

Download Free eBook

Step 1 of 4

Name(Required)

We’re committed to your privacy. Hakin9 uses the information you provide to us to contact you about our relevant content, products, and services. You may unsubscribe from these communications at any time. For more information, check out our Privacy Policy.