Has anyone experimented with using Python within LC?

Geoff Canyon gcanyon at gmail.com
Tue Jul 25 14:48:20 EDT 2023


On Fri, Jul 21, 2023 at 4:10 PM Bob Sneidar via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Out of curiosity, what can be done in in Python that cannot be done in LC
> Script?
>

I'm learning more as I study python. This is pretty nice:

import re
x = re.split('[a|t]','this is a test and this is another')
print(x)

['', 'his is ', ' ', 'es', ' ', 'nd ', 'his is ', 'no', 'her']

Or if you want the dividers as well:

import re
x = re.split('([a|t])','this is a test and this is another')
print(x)

['', 't', 'his is ', 'a', ' ', 't', 'es', 't', ' ', 'a', 'nd ', 't', 'his
is ', 'a', 'no', 't', 'her']


More information about the use-livecode mailing list