Thanks John...I am in the process of re-writing the book with supporting videos, etc...one step at a time.  It will be an e-book this time around because a printed version makes no sense in an environment like OSS (or IT for that matter).  I have a new P9 box that I plan to leverage just for working examples of a lot of open source stuff.  I no longer have customers or work for an organization that has an IBM i workhorse in production, so all of this is a labor of love for the platform.

The python 2 vs 3 issue joins all the other version changes that live in examples on the Internet.  Nothing like a search to give you all sorts of good, and bad, examples  :-)


Pete Helgren
www.petesworkshop.com
GIAC Secure Software Programmer-Java
Twitter - Sys_i_Geek IBM_i_Geek

On 1/9/2020 3:25 PM, John Yeung wrote:
On Thu, Jan 9, 2020 at 3:45 PM Pete Helgren <pete@xxxxxxxxxx> wrote:
https://github.com/phelgren/OSSGarden/tree/master/python
Pete, I'm always glad to see resources for learning Python on IBM i,
so thank you for sharing that.

One thing I think prospective readers need to know about your examples
is that most if not all of them are for Python 2, which is still
usable of course, but officially no longer supported by the official
Python development team (the ones behind python.org).

Fortunately, most if not all of your examples have only one
Python-2-specific feature, which is print statements. In Python 3,
these are replaced by print function calls. So where you have

print 'Hello, world!'

in Python 2, you have to change it to

print('Hello, world!')

for Python 3. It's a slightly annoying but very straightforward and
superficial change. There are other differences which are more
substantial, but so far I haven't seen any come up in your examples.
(I haven't looked at them all, though.)

John Y.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].