Reputation: 33273
I am usually working in fields of machine learning and hence my background is mostly in stats/ML and no formal web background. Usually for my project, I work on python which is connected to my local mysql db... to fetch data adn everything. Now, my work is mostly complete.. everything is console based.. (like traditional programs). How do I integrate it on the front end. I understand that this is more like a server side scripting. So, lets take an example of google. In the front end.. someone enters a search query.. and in the backend lets say there is a program in C++ which executes that query. How did this interaction takes place.. if front end is written in lets say php.. I assume shell execution of program is a bad bad way to run programs.. ?? Any suggestion will be greatly appreciated. Thanks
Upvotes: 20
Views: 50294
Reputation: 943995
Decouple your user interface logic from your business logic, then reuse the business logic libraries in an application that accepts input over HTTP instead of the console. Django is a popular web framework that will take care of a lot of the front end concerns for you, or you can use something like CGI if you prefer to be a bit closer to the bare metal. The Python Wiki has a section on web programming that you might find useful.
Upvotes: 6
Reputation: 1458
As suggested by Ignacio, you will first need to design API for your project. This is basically clearly laying out what (and how) queries will be supported for your project.
You don't need shell execution and neither need to learn PHP. Since your project is in Python, you can use Python Web-frameworks like Django, Web2Py.
Upvotes: 8
Reputation: 799082
The first thing to do is to develop an API for your library. From there you can develop multiple frontends that use the same API in order to present it multiple ways.
Upvotes: 6