Learn to Code via Tutorials on Repl.it!

← Back to all posts
Create a command pad to minimize your efforts and make your work easy
AyushMoghe

The post is about a project that how to make a commanding pad in python that will minimize your efforts of downloading youtube videos, solving algebra and doing factorization with getting ip address of a site, converting image to ascii art, getting approximate average of numbers as well as many more things!

So let's start

First of all we have to download all the python modules listed below:

So basically what we are doing we are combining all the uses of our python modules and making the command pad named Asst Prompt

These are only some of the python modules we will see many others in our code.

Now, It's time to code

First of all we have to create a lexer and a paraser that will not show any error.

Yes, it's done.

Why we have ignored errors? Because after all the things when we will run our pad we will get error after each line so this is the reason we have not inserted errors in it.

Now, The second thing is to make several functions:

These are several functions that will make our Asst Prompt much better

Now let's add some custom animation to our Asst Prompt!

The reason we have added cls function in our code is displayed below

Now it's time to handle the loop break when ctrl+c is pressed.

The function main here refers to the main part that will be executed in the while loop at the last.

It's time to add some more functions to our command pad(asst prompt)

okay, so we have complete some of the code that is required to make the asst prompt!

After this we have to proceed for user input.

And this is the line where we have to parse our code.

But main() function cannot be so small so let's proceed for the commands of asst prompt.

It seems to be much large code! let's discuss some of it's commands

1. press: presses the keyboard keys

For example:

And we all know what happens when we press windows key + r
It will open run pad

Then the next is type command which is just same as the echo command of cmd / batch script that will print the text we want

And these two are the most basic commands of asst prompt.

Have you noticed a function ascii is added in the code where all the commands are mentioned

Yes it is for converting image to ascii format.

Just type ascii and hit enter. Then type the path of the image, it will convert it to ascii.

The solve command is another command in asst prompt which will help us to solve algebra and alongside there is a factor command for factorization of algebraic expression. When combined and used as solve factor expression of your choice can also divide the polynomials. The credit goes to the creators of sympy module.

There is also a function named delete this acts just like the del command of command prompt.

Bin converts the numbers to binnary code.

@ separates common words and characters from the sentence or string.

ip command calls the ip address of the website

inspect shows the code of inspect column of a webpage.

open command opens the required link or a path of our pc.

There is also a thing named late value and ease var in asst prompt that I have added.

late value refers to the line, character, integer or string that is after the question mark

likewise ease var refers to the line, character, integer or string before the string

For Example:

With the help of late value and ease var we can also find average and many other things.

Like:
For average

Ignore the number 6 that is displayed.

For getting biggest number written among many numbers

  • Note: except late value and ease var all other commands should be before the line and there should be space in each of them.

So Now it's time to execute our Asst Prompt!

Output:

You can also explore more commands of asst prompt in it's code and can also add your own.

Thanks!

Voters
RtoonTV
MattDESTROYER
AyushMoghe