Home » Tag Archives:python

Tag Archives: python

Getting PHP to run a Python script

February 12, 2018 Php Leave a comment

Questions: I am trying to run a Python program using PHP. Here’s the code $command = '/usr/local/bin/python script.py file'; $temp = exec($command, $output); This works through the command line ...

PHP: get array value as in Python?

February 12, 2018 Php Leave a comment

Questions: In Python I can use “get” method to get value from an dictionary without error. a = {1: "a", 2: "b"} a[3] # error a.get(3, "") # I got empty string. So I search for a common/bas...