Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > General Support > Topic : Python on AMPPS


Poll
Poll Question : Using Python on AMPPS
I use Python on AMPPS (4) (100%)
I don't use Python on AMPPS (0) (0%)

Total Votes : 4




Threaded Mode | Print  

 Python on AMPPS, Installing script python on AMPPS Mac El Capitan (2 Replies, Read 7456 times)
patatex
Group: Member
Post Group: Newbie
Posts: 1
Status:
Hi everybody,

AMPPS is well working on my mac (El Capitan), I would like to execute Python scripts, but I don't know what I have to do and what files should I modify?
Is there someone who could explains me, step by step, the best way to achieve my goal.
I Tried to follow what is written in a post ( dated 2012) on this forum, but it doesn't work.
Do I  need to create a wsgi-scripts folder, or cgi-bin is enough ? Should I modify python.conf and / or http.conf ? And If so, may you show me correct files.
I thank you, to give me any reply.
Pat.
IP: --   

Python on AMPPS
lysakowski
Group: Member
Post Group: Newbie
Posts: 3
Status:
How come nobody from Softaculous ever responds to these threads?  Does that require payment?  What's going on with technical support? 

Is the user community so small that noone reads these posts for assistance? 

:-(
IP: --   

Python on AMPPS
Rishi_P
Group: Member
Post Group: Elite Member
Posts: 317
Status:
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

IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is March 19, 2024, 7:56 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 12  |  Page Created In:0.266