Skip to content

alfredodeza/basic-python-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic Python CLI

An ultra basic Python CLI example with no frameworks or dependencies. In just a few minutes you can have all you need to create a super simple, single-file Python CLI tool without any external dependencies or frameworks.

Watch the Video tutorial

Build a simple CLI in Python tutorial

What you will learn

Build a very simple command line tool with Python without using external dependencies or frameworks. In this video you'll see how with just a few lines of Python you can transform a file into a script with a help menu.

Although you can create more powerful command-line tools with other frameworks like argparse or external libraries like Click, you can still implement a quick script without them that includes a help menu

Why would you want to do this

Because you need something very quick, easy to run, ideally with a single argument, and most of the time for other systems to use. No need for fancy help menus (although you can add those), and hopefully with a single task to do.

Next steps

Now that you know how to do this minimal Python CLI tool, you can try out other frameworks like Python's argparse module or the Click framework. I have examples and guides for argparse CLI tools and for using the Click framework.

About

An ultra basic Python CLI example with no frameworks or dependencies

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages