× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



That's what I've been doing. I use the platform = platform.system()
function to determine what system I'm on, and then go from there.

Been working well but always curious about what others are doing.


Thanks,

Jason E. Olson
IBM i Engineer/Developer
josys36@xxxxxxxxx
480.223.2952


On Mon, Jul 8, 2019 at 2:24 PM John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:

On Mon, Jul 8, 2019 at 2:43 PM Jason Olson <josys36@xxxxxxxxx> wrote:

There seems to be a few things that don't work the same on IBM i Python
as
they do on Windows Python. For instance, reading data from IBM i tables I
have had to do one method on Windows and another on IBM i.

With the recent release of the ODBC driver for PASE (downloadable from
the same place that you get ACS), the small differences in reading
tables is reduced to nothing.

Even before this driver became available, the only significant
difference was one import statement at the top and the connection
info. From Windows:

import pyodbc

conn = pyodbc.connect(
driver='{IBM i Access ODBC Driver}',
system='1.2.3.4',
uid='username',
pwd='password')

From PASE:

import ibm_db_dbi

conn = ibm_db_dbi.connect()

Other than that, you could use identical code for working with Db2 for
i tables from both Windows and PASE. While there are other minor
differences between pyodbc and ibm_db_dbi, it is still quite simple to
write code that works for both.

Notice that ibm_db_dbi from PASE doesn't require any connection
information at all if you just want to use the credentials of
whichever user is running the script. But now, with the new ODBC
driver for PASE, you can use the Windows code verbatim on PASE, if you
want.

John Y.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

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.