jeudi 2 mars 2017

Trying to display a chart made in python in a web page made in php

First of all I'm not a developer, but recently I began to code for my University projects.

I have a Python file that creates a graph and a PHP file. I want the PHP file to run the Python and display the chart in the web page that I'm working on. I'm using matplotlib to create the graph.

1.Python code

import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.ylabel('some numbers')

2.PHP code

<?php 
echo 'Hey ho let\'s go';
$result = exec("python chart.py C:\wamp64\www\test");
echo $result;
?>

Thanks!!




Aucun commentaire:

Enregistrer un commentaire