When running the python script from PHP, the relative path used to open d3.min.js causes a file not found error. Using an absolute path allows it to work correctly
I'm not a Python programmer... so might be a better way to do this... but testing on my local server it works as expected.
import os
...
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'd3/d3.min.js')) as js_file:
d3 = js_file.readlines()
When running the python script from PHP, the relative path used to open d3.min.js causes a file not found error. Using an absolute path allows it to work correctly
I'm not a Python programmer... so might be a better way to do this... but testing on my local server it works as expected.