Command line programs in a web (python)
Based on what you've described, there are many ways to approach this:

Create a terminal emulator on your webpage.
If you want nicer UI, you can set up any web framework and have your command line programs in the backend, while exposing frontend interfaces to allow users to input parameters and see the results.
If you're just trying to surface the functionalities of your programs, you can wrap them as services which application can call and use (including your web terminal/app)
I am new to programming and web apps so i am not even sure if this question is obvious or not.
Sometimes I find command line programs more time efficient and easy to use (even for the users). So is there a way to publish my command line programs with command line interface to a web as a web app using cgi or Wsgi? 
For example if i make a program to calculate all the formulas in math can i publish it to a web in its command line form? I am using python in pycharm. I have tried using cgi but coudnt do much beacuse cgi has more to do with forms being send to a data server for information comparison and storage.
-Thanks