¿ªÔÆÌåÓý

Locked Re: What's a good way to learn jython?


 

Don,

Do you want to learn Python to create your own applications or be able to create Jython scripts within the JRMI environment?

Assuming Jython, doing a Python course, while potentially interesting, is overkill. ?You will not be using many of the features, and the Jython environment has its own requirements since it is running within Java with access to the JMRI objects.

Since Python 2 is officially retired, most information will be released to Python 3. ?Jython is based on Python 2.7 so current courses and other information will not be relevant.

The JMRI help,?, has lots of information for getting started. ?The jython directory located in the JMRI install has many scripts. ?These can be a good reference.

The first thing you need is a good Python aware editor. ?For Windows, Notepad++ is good. ?An IDE (integrated development environment) is generally not useful since they don't know anything about Java and JMRI.

Python uses indents to convey structure, such as if/else, loops, etc. ?Make sure you editor uses spaces for indents, generally 4. ?Never mix tabs and spaces. ?A good editor will convert tabs to spaces while typing.

Always have the JMRI system console open so that you can see Jython errors.


Dave Sand


----- Original message -----
From: Don Weigt <dweigt47@...>
Subject: [jmriusers] What's a good way to learn jython?
Date: Thursday, January 09, 2020 6:33 AM

Following along, it seems at some point I'm going to need to write some of my own logic.

I learned Intel assembly language and QuickBASIC decades ago. But C and C++ stumped me. Is it realistic to think I can learn to program in Jython? My impression from bits in the messages here, is that it's "C like". I'm 75 years old, and it's harder for me to learn complex new things than it was...

Also, I have a mailing about "The Great Courses", and one of them is a 24 lesson course in Python I could order for $35. Might that be useful? Or, is there some programming manual I should buy? I don't want to ask a million beginner's questions on the list. But, what's a good way to learn to program in Jython?

Don Weigt
Connecticut, USA

Join [email protected] to automatically receive all group messages.