Differences

This shows you the differences between two versions of the page.

Link to this comparison view

python_on_ibm_i [2018/11/29 19:56]
python_on_ibm_i [2021/04/05 11:23] (current)
Line 1: Line 1:
 +====== Python on IBM i ======
 +
 +===== Running Python =====
 +
 +By default the python lib scripts are placed in ''/python27''. This can be changed to anything you want. I want my to be at ''/usr/local/lib/python27'' so that I don't spam the root folder with folders and files.
 +
 +But if you changed the home folder of python you need to set the environment variables so that the program will find them.
 +
 +    ADDENVVAR ENVVAR(PYTHONHOME) VALUE('/QOpenSys/usr/local/lib/python27')
 +
 +That should suffice though you can also set the lib path like this:
 +
 +    ADDENVVAR ENVVAR(PYTHONLIB) VALUE('/QOpenSys/usr/local/lib/python27/lib')
 +
 +<note>I use the QOpenSys file system to store the files because it provides more compatibility with the more Unix like world and just add a symlink from /QOpenSys/usr/local to /usr/local .</note>
 +
 +
 +===== DSM =====
 +
 +DSM supports Python with the ''dsmsup.py'' script and the ''DSMPYT'' service program.
 +
 +One has to take care that all service programs are created with a compatible storage model, either ''*TERASPACE'' or ''*INHERIT''.
 +
 +
 +===== Resources =====
 +
 +  * [[https://bitbucket.org/pegu/iseries_python27/src/default/as400/_os400.c]]
 +  * [[https://bitbucket.org/buzzh/api2]]