Last active
August 29, 2015 14:03
-
-
Save zzjin23/2eb3af0123ae4b194539 to your computer and use it in GitHub Desktop.
Execute PHP using Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
# if the script don't need output. | |
subprocess.call("php /path/to/your/script.php") | |
# if you want output | |
proc = subprocess.Popen("php /path/to/your/script.php", shell=True, stdout=subprocess.PIPE) | |
script_response = proc.stdout.read() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment