Read the statement by Michael Teeuw here.
Run Python script which creates a JSON file
-
Hi, I am trying to test something and am wondering the best way to do it (unrelated to node/mirror). I have an HTML page with a button and a JavaScript file which parses a local JSON file and presents results on screen. I also have a Python script which I run prior which creates the local JSON file. Is there a way for me to click this button in my HTML, run the Python script which creates the file then run my JavaScript file which shows the output?
Thank you
-
You could do it the other way round. Your MagicMirror javascript module could run the python script and wait for its output/result.
See here: https://forum.magicmirror.builders/topic/1981/python-to-javascript -
@yawns Ahhh perfect - I am going to try that, that should definitely work when implementing on the mirror. But for now I am actually just trying to test this very primitive code to see if it is possible the other way around. I have seen an ajax call needed but am not 100% sure as to where I’d put that in the code or how it would be configured to just run a local python file which outputs nothing but another file.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login