Partly resolved.
Still have questions. First what went right:
Your code worked for me. I created a fresh Love project to test it. I put the code in main.lua. Inside the Python files, I changed all the relative paths to absolute paths. At that point, io.popen worked perfectly. It successfully called the Python file and passed an argument. The Python file then outputted a json file to the right directory.
Unfortunately, my full project doesn't run when I insert that same code. I don't know why because I'm not getting error messages. I'm not getting anything. I am launching Love in the only way I know how: cursor in main.lua, cmd+l. I can see it's starting to work because the Love icon in my dock is activated, but the game/error window does not appear on my screen.
How do you run Love from a terminal? Can it be done as main.lua or does it have to be fused first into a .love file?
The command lua main.lua doesn't work for me. It throws an immediate error, not recognizing the 'love' in function love.load(). I updated my PATH according to:
https://love2d.org/wiki/Getting_Started, but that command seems to need a .love file or a zip folder? It gives me a 'No Game' window when I run it from the game directory (consisting of unzipped main.lua plus assets, etc.) and an error when I specify main.lua.
I know I'm probably off topic now. Should I have started a new topic?
Thanks again.