[kepler-users] Installing Python/Jython modules

ben leinfelder leinfelder at nceas.ucsb.edu
Wed Apr 29 11:20:48 PDT 2009


Hi Daniel,
I'm not too familiar with using Python modules - but it seems like you  
should be able to "import" the py-appscript module in your Python  
actor script if you already import that library using the built in  
python on your mac.
I did find a slight disclaimer on the Jython site about modules not  
all working happily.
http://www.jython.org/Project/userfaq.html#what-parts-of-the-python-library-are-supported

The key sentence would be:

"If you want to use a standard Python module, just try importing it.  
If that works, you're probably all set. You can also do a dir() on the  
modules to check the list of functions it implements."

The full section reads:
-----------
4   Jython modules
4.1   What parts of the Python library are supported?
The good news is that Jython now supports a large majority of the  
standard Python library. The bad news is that this has moved so  
rapidly, it's hard to keep the documentation up to date.

Built-in modules (e.g. those that are written in C for CPython) are a  
different story. These would have to be ported to Java, or implemented  
with a JNI bridge in order to be used by Jython. Some built-in modules  
have been ported to JPython, most notably cStringIO, cPickle, struct,  
and binascii. It is unlikely that JNI modules will be included in  
Jython proper though.

If you want to use a standard Python module, just try importing it. If  
that works, you're probably all set. You can also do a dir() on the  
modules to check the list of functions it implements.

If there is some standard Python module that you have a real need for  
that doesn't work with Jython yet, please send us mail.

-----------
-ben

On Apr 23, 2009, at 7:01 PM, Daniel Korytina wrote:

> How can I install a python module?
> (I could not find this in previous posts.)
>
> Specifically I would like to install the py-appscript module, and  
> call it from the Python actor.
>
>
> Thank you,
> Daniel
> _______________________________________________
> Kepler-users mailing list
> Kepler-users at kepler-project.org
> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>




More information about the Kepler-users mailing list