arraytopythonlist(
ARRAY
,
SEPARATOR
)

The arraytopythonlist( function converts a panorama array into a Python list.


Parameters

This function has two parameters:

array – the array to convert.

separator – the separator character.


Description

This function converts a Panorama array into a Python list.

arraytopythonlist("red/green/blue","/") ☞ ['''red''','''green''','''blue''']

To use this in python code use

^«arraytopythonlist(formula,sep)»^

for example:

mylist = ^«arraytopythonlist(Colors,cr())»^

Note the use of ^ instead of $.

See Text Arrays for more information about arrays.

Note: This function is equivalent to:

"["+replace(arrayfilter(thearray,thesep,||| pythonconstant(import()) |||),thesep,",")+"]"

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.