a tip for anyone trying to use the pyferret module from python:
when trying to follow the tutorial for calling ferret from python,
note that setting PYTHONPATH is not enough: you also need to set
LD_LIBRARY_PATH to include
$FER_DIR/lib/python2.7/site-packages/pyferret .
If you don't, ferret will complain that it cannot load
$FER_LIBS/ferret_ef_mem_subsc.so when called from a pure python
script. Everything works fine when calling ferret with the pyferret
script, as it sets LD_LIBRARY_PATH for you.
Perhaps it's worth updating the manual with this information.
I also have a question: what is the difference between
pyferret.start() and pyferret.init()? When I call pyferret.init() I
get an error:
> Python 2.7.3 (default, Aug 1 2012, 05:14:39)
> [GCC 4.6.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import pyferret
> WARNING: Unable to import cdms2 and/or cdtime;
> the Python functions pyferret.get and pyferret.put are not available
> >>> pyferret.init()
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/net/nas/data/applications/ferret/pyferret-6.8.2/64/lib/python2.7/site-packages/pyferret/__init__.py", line 136, in init
> if not '-secure' in arglist:
> TypeError: argument of type 'NoneType' is not iterable