Pustaka Taratsa
PHP: Memanggil python

PHP: Memanggil python

Penulis: Onno Widodo Purbo

Sumber: http://stackoverflow.com/questions/166944/calling-python-in-php Contoh 1 You can run a python script via php, and outputs on browser. Basically you have to call the python script this way: $command = "python /path/to/python_script.py 2>&1"; $pid = popen( $command,"r"); while( !feof( $pid ) ) { echo fread($pid, 256); flush(); ob_flush(); usleep(100000); } pclose($pid); Note: if you run any