Amiga Python Modules

Amiga Python
Python is an integrated part of AmigaOS and has been greatly enhanced for the AmigaOS 4.1.1 update. For example, you can execute a Python script by setting the script bit and then typing in the shell:
> hello.py
just as you would for an ARexx script.
As of this writing, there are four AmigaOS-specific Python modules available. Each module accesses a specific piece of functionality which is unique to AmigaOS and therefore is not generally available in the generic Python distribution.

asl Module

The Amiga Standard Library (ASL) is a collection of GUI requesters which are designed to save programming effort and offer a consistent GUI for the user. This Python module is designed to access those requesters. Currently, only the file requester is available.

arexx Module

The ARexx module enables access to ARexx from Python so that you can send commands to an ARexx host for example. You can also setup an ARexx host using a Python script.

catalog Module

Amiga locale catalogs can be accessed using this module so that your Python script can become localized using standard Amiga catalogs.

icon Module

Amiga icons are stored in a special format which can be accessed and manipulated from Python using this module.

More specific information about these modules can be found in your Documentation/Python drawer and also by using the built-in Python help.

Creating Your Own Modules

Creating your own Python modules is simple but requires a bit of boilerplate code due to AmigaOS' handling of shared libraries and shared objects. Python modules are implemented as a shared object (.so) files and are stored in the PYTHON:Lib/lib-dynload directory. All Amiga libraries (.library, .device, etc.) can be accessed from a shared object so programmers can do pretty much anything they please.

To help you get started, a complete example with source code is included below which you may use to build your own Python modules for AmigaOS.

GUI Module Example C Source
GUI Module Example Makefile