|
Hans wrote: > But since this is Friday, I thought I'd be a trouble-maker > and provide a solution in Python instead: :-) ;-) :-) > > -------------------------------------------- > # Print words of string: > str = 'This is a test. And so is this.' > for word in str.split(): > print "string:\t", word > -------------------------------------------- James responded: >Oh boy - I *have* to get python going on my system! But can I >call a python function from an RPG module? To be honest, I've never used Python on the iSeries. My Python experience has been primarily on Linux, with some use on this WinNT system here at work (which behaves almost like a real O/S.) I doubt if you could call Python functions directly from an RPG program since Python is an interpreted language. But I'm sure you should at least be able to call a Python program using QCMDEXEC. Another way to use Python would be to use the Jython compiler which compiles Python down to Java bytecode. Then you could handle the Python program the same way you'd deal with Java objects. If you already know how to call Java methods from RPG, this just might be the easier way to call Python functions. You've probably already found this using a web search, but here's where you can find a recent native iSeries port: <http://home.no.net/pgummeda/>. Cheers! Hans Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.