I'm new to all things programming, but am trying to build up some functionality for my team.
I have a script in python that performs some useful analysis, and now I need it to communicate to a PHP script that I usually call from the command line with an argument that is a text file, which the script parses and operates on line by line.
What I'm trying to do is pass to the script in the CLI a list variable from Python.
Is the best way to do this to write the list to a text file on my server and then call the script with subprocess from Python or is there a more streamlined way to make this happen?
Writing the data out to a text file in python and then loading that text file in php is definitely the easiest way. If you're willing to modify the php script, you could make it read the data from stdin, and set up a pipe between the two processes, but this going to be a little trickier.
Can I pass a list from python to a php script that usually takes a .txt file line-by-line to operate on?