TechieYan Technologies

Python command line Application

Abstract

A command-line interface, also known as a command language interpreter (CLI), console user interface, or character user interface (CUI), enables us to interact with programs by giving them instructions in the form of text on a single line. In this project, you will be able to build Command line functions in python, The main advantage of CLA is its effectiveness, the one can save lot of time and can complete the programs in less time than it’s required in General.

So, this CLA can be used as an automation to some of the most used function. We have to pass an Argument to get it executed. Argparse python library has been used to pass the arguments to our program. The application is basically divided into parameters and are called with the assigned variables. In our project x, y and o are used as variables (x and y as the input parameters and o as the function to be performed). Specifically, this program works in the form of a calculator, but as an enhancement for this we ca even add some more functionalities to make it more flexible and easier for the user.

bash, command-line, linux-148836.jpg

Programming Methodology

  • The argparse module was first imported, followed by the creation of an Argument Parser object and the inclusion of a description of our program.
  • Now, we can add arguments to our parser object to populate it with data. In this illustration, an argument add was made. The add function accepts a large number of parameters. The ones I used in my example above are explained here: The ones I used in the example above are explained here:
  • First argument: “Add” It is nothing more than the argument’s name. The add function accepts a large number of parameters. The ones I used in my example above are explained here: (nargs = ‘*’).
  • Argument 2: If you specify it as “*,” it can have any number of parameters, ranging from 0 to anything.
  • Argument 3: A name for the (metavar = “num”)

How to Execute?

 

Step 1 :

You need to open the jupyter notebook in the path directory on the anaconda prompt shell.

In my case

GUI Application for Calendar execution code

         

To perform the above step you already need to have knowledge of installing jupyter notebook and running anaconda shell, if you don’t know how to install or run jupyter notebook check our previous articles about it.

Step 2 :

 

         Install required libraries

 

         In anaconda prompt type pip install –r requirement.txt

 

OUTPUT

 

Issues you may face

  1. While giving right path in the Anaconda prompt shell to open jupyter notebook in correct directory.
  2. Make sure you are in the right path of where you have saved all your executable files and then enter python main.py followed by the arguments which you have specified.

 

Note:

All the required data has been provided over here. Please feel free to contact me for model weights and if you face any issues.

http://techieyantechnologies.com/contact/

Yes, you now have more knowledge than yesterday, Keep Going.

Click Here To Download This Code And Associated File.

 

+91 7075575787