Running python program using php
Script which takes a string and will test to see if it is palindromic . I have written the python script for this like:
a = raw_input("Enter the word: ")
b = a[::-1]
print b
if (a == b):
print("Yes")
else:
print("No")
when calling this python program via php I don't know how to give the input. Please help me!
• 1,631 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Why not write your function in php ? Using HTML to catch the user input and php to process it
Btw I think this thread would have be better on StackOverflow
Sorry but I need know how it works with python
If it is a scholar test you have to say it in your post.
That said, you can call a python script in php like this
I don't know how you want to pass your input (html form, php variable...)
I suggest you to create a HTML form with a php file catching the form result. Create a python script with an input parameter.
No need the :
When the user submit the form, catch the input in php and run your python script with the catch from the form as input parameter.
Hello ttananthi97!
We believe that this post does not fit the main topic of this site.
It's purely a technical problem and you need to learn what is a server, how to run a script from php and how to avoid any interaction. I'm closing this question as it's not related to bioinformatics
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!
Please use the formatting bar to indicate code: