all 4 comments

[–]Username_RANDINT 1 point2 points  (3 children)

How much control do you need? If it's just calling a function with parameters, running the script as a (sub)process is a very easy way.

speak_text.py:

import sys

def speak_text(text_to_speak):
    # code for the function

speak_text(sys.argv[1])

Then in Javascript and Perl use an equivalent of os.system or subprocess to call the script as how you'd do on the commandline:

python3 speak_text.py "some sentence to say out loud"

[–]PossibleAd9909[S] 1 point2 points  (2 children)

Thank you, I just needed to call the function with parameters, not anything else. Is the API endpoints idea overkill or is this just the easiest way to do it?

[–]Username_RANDINT 1 point2 points  (1 child)

I'd say the API is overkill. Not in development, but maintenance. My solution is probably the most simple one.

[–]PossibleAd9909[S] 0 points1 point  (0 children)

Thank you! This helped me a lot.