Search code examples
pythonphpweb-applicationsbackend

How to use a python script in a backend?


How you can read in the title: How can I use and integrate a Python script in a backend from a web applicaton? The backend use php as programming language and the database MySql.


Solution

  • If you want to run a python script from PHP, you can use one of the many PHP functions which do this, for example: exec().

    Depending on what you want, it can be as simple as:

    <?php
    exec('python script.py');
    ?>