Hi,
You can run python script from cgi-bin folder, use following steps:
Go to /path/to/Ampps/www/cgi-bin folder.
Create one test.py file and copy following code in it. In first line put actual path to your Ampps folder.
Quote
#!/path/to/Ampps/python/bin/python
print ("Content-type: text/plainnn")
print ("Hello world")
Save it, restart Apache.
Now access your file on browser with following url:
localhost/cgi-bin/test.py
You can also call your .py file in .php and execute that.
create one test.php in /Ampps/www folder and enter following code in it.
Quote
<?php
$data= exec('python C:Amppswwwcgi-bintest.py');
echo "File Contain " . $data;
?>
Now run above file on browser, localhost/test.php
|