× 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.



I have python 2.7 and and just upgraded python3 from 3.4.6 to 3.6.9 .

Python 3.4.6 is from 5733-OPS and should be removed if possible.
Everything is more straightforward if you exclusively use the stuff
which can be installed via yum. (If you use ACS to view and install
packages, then you're using yum.)

I will let someone else address the multiple profile issue. (Or maybe
a future version of myself.)

From python can I create spool files? Don't know if I want to just wondering!

Yes. By default, the normal Python output (from the print function) as
well as Python's error messages are sent to QPRINT if invoked in batch
mode.

Trying out a sample I found to create a spreadsheet, I found I needed to import xlsxwriter. I did not see that listed under the ACS Package manager, but was able to do a PIP Install. Just trying to understand when and why I should use ACS vs PIP.

pip is Python's package manager. It automatically finds, downloads,
and installs Python packages and their dependencies. It cannot handle
packages unrelated to Python. There are some packages *for* Python
which are implemented solely *in* Python, and virtually any of these
can be installed using pip. XlsxWriter is such a package.

However, there are some Python packages which are implemented at least
partly in some other language (typically C or C++) which needs to be
compiled to "machine" code. (I put that in quotes because IBM i of
course utilizes quite a bit of virtualization.) pip will attempt to
call the necessary compiler to build this code, but if the compiler
isn't present, or if the code is written in such a way that it's not
PASE-compatible (something may compile fine on Linux but not
necessarily on PASE), then pip will fail. The folks at IBM have been
trying to identify packages like this and make the necessary tweaks to
get them working on PASE, and once they do, they release something
called an RPM, which is a package that is installable by yum or ACS.

The relationship between pip and yum is this: both perform similar
functions (find, download, install packages), but pip is the package
manager for Python while yum is the package manager for the whole
system (which in this case is PASE).

Can I connect to sql server from python running on the I. I tried to import pyodbc, but it is failing. Should I be using this?

You should, but you need to install the ODBC driver, as well as the
unixODBC package, as well as the pyodbc package.

Can someone point me to some slightly more advanced example of connecting to db2 and creating a report.

I don't know of any. I know there are a few that involve connecting to
Db2. Have you done that part yet? There is very little to it, and once
you're connected, you use SQL to retrieve what you want.

Most people generate Excel output rather than spooled files. You can
find examples for that (sounds like you already did). If you can work
through both ends (input from database, output to Excel workbook),
then you are most (if not all) of the way there.

I think Python in PASE is new enough that there are very few published
examples of working in it. For now, I would guess it's more fruitful
to try what you can, then ask for specific help on this list or Ryver
when you get stuck.

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.