Forum Discussion
Syntax for checking if a value is in an array is the same as in javascript.
Try:
[30,40,50].indexOf(30) != -1 —> true
[30,40,50].indexOf(90) != -1 —> false
The reason for the “!= -1” is that indexOf returns -1 if the element is not found in an array. Otherwise it returns the index.
Same method works for strings.
Thanks, got it working 🙂
- ptaylor5 years agoEmployee
Yes, if it’s Python 2.x compatible and doesn’t do anything too weird.
It does require some special configuration on the plex node though. You create a file called
.jython
in the home directory of the user that the jcc runs as. In that file you would definepython.path=
/the/path/to/the/root/of/your/python/library/collectionfor example, on my system it would be
python.path=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
Then in your Script source, you can just import any of the packages that are present under that path.
Related Content
- 2 years ago