David Clark wrote:I have a Mac mini with version 2.7.1 of python installed.
The current version of Python is 3.6. The latest version of Jython was released in May 2015.
David Clark wrote:
Can I install the latest version of Python over the installed version or must I uninstall the current version of Python?
David Clark wrote:
I'm a bit confused as to the Jython/Python relationship. I know that the Jython/Python syntax is identical.
Is Jython the same language as Python?
Yes. Jython is an implementation of the Python language for the Java platform. Jython 2.7 implements the same language as CPython 2.7, and nearly all of the Core Python standard library modules. (CPython is the C implementation of the Python language.) Jython 2.7 uses the same regression test suite as CPython, with some minor modifications.
There are a number of differences. First, Jython programs cannot currently use CPython extension modules written in C. These modules usually have files with the extension .so, .pyd or .dll. If you want to use such a module, you should look for an equivalent written in pure Python or Java. However, it is technically feasible to support such extensions, as demonstrated by IronPython. For the next release of Jython, we plan to support the C Python Extension API.
There are a number of other differences between the two implementations that are unlikely to go away. These range from the trivial - Jython's code objects currently do not have a co_code attribute because it is not possible to directly access Java bytecode from a class, without loading the file; to the significant - Jython uses Java's true garbage collection rather than Python's reference counting scheme.
David Clark wrote:
Is the current version of Python compatible with the "current" version of Jython?
Jython 3.x development is in progress.
Jython 2.7.0 was released on May 3, 2015. Jython 2.7.1 release candidates will be released soon (September 2015).
David Clark wrote:
Since I have a Mac, is it possible to write a Python program on my Mac that will run on a Windows PC?
David Clark wrote:
I can't decide!
Yes, there is no simple answer other than trying out a few tools and seeing what works best for you.
David Clark wrote:This is a Java example of my question.
for (int x = 2; x <= 4; x++)
System.out.println("Value of x:" + x);
Obviously, the Jython/Python syntax is different from the Java syntax, but can one use the <= or >= or != sign in a Jython/Python For loop?
Travis Risner wrote:Python loop variables (i.e. "x") only need to iterate over something. They are not restricted to integers as in Java or C#.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
David Clark wrote:Python doesn't have a Boolean variable type.
Don't get me started about those stupid light bulbs. |