DEV Community


Posted on

How do you make arguments in bash with python?

I've recently used django to make websites, and while making them, I found that I could enter arguments into python files. I used python <arg> and it would do the specific things that it's supposed to do. I tried looking into to see how this was possible, but there was nothing there that would allow me to customize these args. (these arguments are honestly hard for me to remember)

So, my question for everyone, is how to make my own arguments? Or how to customize them?

Top comments (3)

orenovadia profile image

Not sure if your question is Django specific or not.
Either way, One of the best libraries out there to build command line applications/scripts in python is click. It is succinct, elegant and way more easy to learn than Python's builtin ArgumentParser.

12944qwerty profile image

No, it wasn't Django specific but click answered my question. Thanks!

micahlt profile image
Micah Lindley

Hm... Iā€™m definitely no Python expert. Iā€™m not sure! šŸ˜