DEV Community

Discussion on: Command Line Utility with Python

Collapse
 
rhymes profile image
rhymes

Hi Fernando, thanks for the article!

These are just a few modules that will make your life easier when it comes to CLIs, but there are tons of them depending on what you are trying to accomplish

It's amazing how extensive Python's standard library is when it comes to utilities for the command line and the operating system.

I use Python 3.4 with pyinstaller anything above I cannot get it to work

oooh that's a pity, are there no alternatives to pyinstaller? Through the search engine I found nuitka which declares support up to Python 3.7, have you tried it?

Functions are divided by responsibility

A very important step in designing a CLI is to take care of exceptions and error. What do you need to show the user as far as messages goes.

Really good points :D

Many people seem to think that because is a CLI feedback is not that important. The user should always know what's going on. Time elapsed, current time, progress, are just a few items to think about when it comes to user feedback in a CLI

I log a lot about what's going on usually, I don't think I've actually used a progress bar but time elapsed, current time and text I do!

Collapse
 
thefern profile image
Fernando B 🚀

Hi rhymes, thanks on the suggestion about nuitka. I haven't tried that one yet, I did try py2exe, and I can't remember what went wrong with that one. Is always a fine line between spending way too much trying to figure out how to compile a python script vs actually writing code to fix a problem. For this I wish it was as easy as Java, can get a jar file really quick.

Progress bars are not required for most quick tasks, in the cli article image, I actually need to add time elapsed now that I think about it, but the progress bar is a nice visual feedback on how fast things are moving along nevertheless. Or not moving along, I've witnessed that too. : ) Thanks for the feedback!

Collapse
 
rhymes profile image
rhymes

Is always a fine line between spending way too much trying to figure out how to compile a python script vs actually writing code to fix a problem.

ahahha I hear you, well, see if you can get it work within a limited time frame, otherwise bye bye, until you'll need features from the more recent Python versions at least.

For this I wish it was as easy as Java, can get a jar file really quick.

Isn't a jar the same thing as a wheel package in Python? A zip with a manifest basically.