How to pass a value from php to python
<?php $print_this = "hello world";
//pass it to python. then echo it in here. "hello world";
?>
how will i pass the value of a variable from php to python and the python will return it and the php will echo it.
import sys
import urllib
from BeautifulSoup import BeautifulSoup as BS
url = '''http://www.kumby.com/avatar-the-last-airbender-book-3-chapter-5/'''
#open and read page
page = urllib.urlopen(url)
html = page.read()
#create BeautifulSoup parse-able "soup"
soup = BS(html)
#get the src attribute from the video tag
video = soup.find("iframe").get("src")
print video
the variable url should come from the php. where in php ,
$url = website
and in that my python code should be
url = $url
or i dont know how. i just heard that the php can call the python. so i was thinking is it possible to pass the variable of php to python .
now the value of variable video should be echoed in php.