text analysis in python
Maurice LING
mauriceling at acm.org
Sun Apr 3 19:36:32 EDT 2005
Terry Reedy wrote:
> "Maurice LING" <mauriceling at acm.org> wrote in message
> news:424FF1CD.2040102 at acm.org...
>
>>Say I code my stuffs in Jython (importing java libraries) in a file
>>"text.py"
>
>
> Just to be clear, Jython is not a separate langague that you code *in*, but
> a separate implementation that you may slightly differently code *for*.
>
Yes, I do get this point rightly. Jython is just an implementation of
Python virtual machine using Java. I do note that there are some
differences, such as, Jython can only handle pure python modules.
However, I'm not a language expert to differentiate language differences
between these 2 implementations of Python, as in Jython and CPython. If
someone care to enlighten, it will be my pleasure to consult. TIA.
>
>>... Will there be any issues when I try to import text.py into CPython?
>
>
> If text.py is written in an appropriate version of Python, it itself will
> cause no problem. Hoqwever, when it imports javacode files, as opposed to
> CPython bytecode files, CPython will choke.
>
In my example, the file "text.py" is coded in Jython, importing Java
libraries. I do get that I cannot import Java jar files directly into
CPython. What I do not get is that what is so special about Jython that
it can "fool" CPython into using Java libraries... or is that there will
always be a need for Java virtual machine and Python virtual machine
when I use Java libraries in Jython... and importing Jython coded files
into CPython....
Cheers
Maurice
More information about the Python-list
mailing list