execute a python process

Dalmazzo's icon

Hi

How can I execute a python process from Max? I record multimodal data using a patch and I need to format the folder where the data is stored and then send it to a repository. This process I already have resolved with a python srcipt, but now, I need to call it from max. How can I do it?

Thanks for the help

volker böhm's icon

if you're on osx, have a look at the shell object (i believe there is something similar for windows).
search for it on the cycling site, it should be there somewhere.
then you have to either include the correct path to python or make the script executable.
hth,
vb

Robin Price's icon

check out pyext

https://github.com/grrrr/py

Dalmazzo's icon

Hi Robin

It doesnt seem to contain py and pyext objects for max, have you tried yourself?

Robin Price's icon

https://grrrr.org/data/dev/ext/macos/max/

soz they live here, I use it all the time it's great.

The help files never got ported but you can work out how to use it by looking at the pd version.

Dalmazzo's icon

Ah I see
Thanks for the link, still missing pyext and it seems py works only on 32 bits. I think I will move to Shell

Robin Price's icon

pyext will load providing you have py in the externals folder, you have to have loaded py first though.

32 bit problem I can't help you with. When I run into that issue I normally run two instance of max and osc them. There's a java python max wrapper dunno if that helps

http://maxobjects.com/?v=libraries&id_library=131&requested=python&operateur=&id_plateforme=&id_format=

vichug's icon

oh it's the same guy making flext. But it seems it hasn't been updated in a while

Dalmazzo's icon

I'm moving the installations question to the github-issues, I'm still missing something because after adding py.mxo to externals and text file to init folder, "pyext" still doesn't work. Perhaps I have to compile the object

Robin Price's icon

Have you tried loading py first prior to loading pyext?

Dalmazzo's icon

Hey Robin, yeap
The version I use is py.mxo-UB-local-2.6.zip
And if I add the object py to max it appears

Dalmazzo's icon

Hi,
Answwer from Thomas "Hi all, i can confirm that it works, in Max 32-bit mode. The binaries have not been compiled for 64-bit mode yet.
I have created Max packages (named py-package-*.zip) that should be unzipped and dropped into the ~/Documents/Max 7/Packages folder.
I assume that everyone has Python 2.7 installed these days."
Now working

Dalmazzo's icon

Hello again

By the way, using shell to execute a python script works like a charm :)

Cameron Bailey's icon

Great to hear about shell! Could you tell me how you've set up python and what kind of messages you're sending the shell? I've been trying but haven't had any luck.

einbahnstrasse's icon

Hi Dalmazzo and others — 

What OS are you running that's working for you? My py package 2.7 version was loading but now suddenly is not; I'm running OSX 10.11.6, and as far as I can recall, I haven't updated anything since the last time py successfully loaded. I've tried Max (7.3.3) in 32 and 64 bit but it won't load in any case. I've also tried both of the latest py packages, the local and system 2.7 versions from April.

Anybody have any thoughts on this?

Thanks —