We\'re using Splunk (A tool to analyse machine data like log files) and have an application in PHP. For some data we need to do a call to our application in php (CLI-based). Unf
Using Popen from the subprocess module:
Popen
import sys from subprocess import Popen output = subprocess.Popen(['php', 'path/to/script.php'] + sys.argv[1:], stdout=subprocess.PIPE).communicate()[0]
sys.argv[1:] contains every command line argument except the name of python script itself.
sys.argv[1:]