Calling Python from Javascript

Jul 23, 2012 at 1:49pm

Calling Python from Javascript

http://www.maxmsptutorials.com/2011/07/11/wtf-is-js-tutorial-2-is-up/

Having recently found out about the js object, having to learn Javascript is something I’d like to avoid if possible.
I’m quite fond of Python and would like to know if it’s possible to invoke Python from a javascript callback, called by Max/Msp.
I would just write my custom code in Python, then return to the javascript that called it.

Would someone point me to an example?

Thanks

#27345
Jul 23, 2012 at 1:55pm

best way is probably:

http://www.loadbang.net/space/Software/net.loadbang.jython

although learning js and/or lua for all your max needs is the best option – does not take long.

good luck.

#82633
Jul 23, 2012 at 5:16pm

Another alternative is to use Thomas Grill’s py external. It is an external that supports python 2.7.
You can load classes and execute code.

http://www.maxobjects.com/?v=objects&id_objet=1688&requested=Python&operateur=AND&id_plateforme=0&id_format=&PHPSESSID=3abd5ee576145ed9675335d299fe796d

#82634
Jul 23, 2012 at 8:15pm

“Another alternative is to use Thomas Grill’s py external. It is an external that supports python 2.7.
You can load classes and execute code.”

Thanks. I will give this a try.

There’s too much about Max to learn, I don’t want to waste any timer leaning any J-languages.

#82635
Jul 24, 2012 at 12:21pm

There is not much documentation on the py external , but here is the help file I created. If you can not
find the scripts for it on Thomas’s website, let me know and I can post those too.

Attachments:
  1. py.maxhelp
#82636
Jul 24, 2012 at 4:09pm

“There is not much documentation on the py external , but here is the help file I created. If you can not
find the scripts for it on Thomas’s website, let me know and I can post those too.”

Thanks Anthony,and to all who replied

#82637

You must be logged in to reply to this topic.