Python and Rev

thierry douez at wanadoo.fr
Sun Apr 3 08:43:08 EDT 2005


Hi,

DS> Back in the early days when I was beginning to explore Rev and was 
DS> doing a good bit of Python work, I remember experimenting with calling 
DS> Python scripts from Rev using the shell() command and having some 
DS> success. I suspect that approach has some real potential when we want 
DS> to do things in Rev that are down at a lower level than Rev normally 
DS> reaches or when we want to do something at which Python is just better 
DS> (perhaps, e.g., XML parsing).

Don't know if you will be happy with this, but let's go :-)

The last BIG project i've made with Rev is based on a full communication
between Rev and Perl ( well, not Python ) but it is so similar in so many ways.

I did a lot of tries with all the commands and functions we have in Rev,
and after a lot of headackes, coffee and Hints from this list, i made a
PerlSocket library in Rev and a RevSocket package in Perl and they talk and talk
for ever :-)

i start by launching Perl from Rev with some parameters , one is the port number
for the sockets. Then i can exchange Information both way, working *only*
with sockets...

 For instance, i can do in Perl
 
         SetaRevProperty( "PerlScript", \$BA ) ;

         which will end by :
          Set the Perlscript of theProject to tData  , in Rev side.

 All this works like a swiss clock  :-)

 At the beginning, i was mixing sockets message and process read and write;
 it was working well, but from this list i've seen so many *bad* remarks
 concerning exchanging datas with the open process for update, that i decided
 to only use sockets.

 This has been tested *thousands* of time before delivering my project,
 and it's used daily by a team in a genetic research centre. BUT, i did
 make it work only on PC machines ( Win98 and NT and w2k ).

 Anyway, all this could have be done with Python or C/C++ or whatever !
  
 When i had time, i will be very happy to write about this more in details
 for the community... well, if some are interested :-)  Are you ?

 Hope that helps,
 thierry
 
>>> Note I didn't say Python "versus" Rev. I'm not about to abandon the 
>>> enviroment that makes my life so easy if not darn pleasant ;-)
>>>
>>> I'm interested if Python and Rev can work together. Python seems good 
>>> at  some of the lower level stuff that Rev can't touch (like COM).
>>>
>>> Does anyone have experience with Python in general and connecting it 
>>> to Rev in particular?
>>




More information about the use-livecode mailing list