Python Libraries and RISC OS


Python Module Libraries

Introduction

You may not need to write that python program. There are so many freely down loadable open source Python programs available on the internet that a program to solve your specific program may have already been written. This does not obviate the need to learn python but a mindset that is open to modifying existing code is worth cultivating.

In September 2020 there were 137,000 known python libraries on the internet. There thousands of programs and modules available from the "Python Package Index" or PIP

That is the Good News, the Not So Good News is that most of the external libraries are written in C and are YET not available to use on RISC OS. My understanding, is that because the modules in the python3 executable are linked statically only modules written in python can be added.

Python Standard Library

The Python standard library contains modules written in C that provide access to system function that would otherwise be inaccessible to Python programmers. It also has modules written in Python which provide solutions to common problems. Some modules abstract OS specifics into platform-neutral APIs.


The RISC OS Python install includes the Standard Library. It consists of 48Mb of data shared accross 2400 directories and files. Very little of it has been tested.

I am in the process of testing the Library and will have a page in this document to record progress and status. Any help would be appreciated.

Pygame

Pygame is an external Library that has been ported to RISCOS.

It is a set of Python modules designed for writing games and multimedia programs in the python language. It interfaces with the cross-platform development library SDL Simple DirectMedia Layer designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.

Notes on usage and some test results

© 2021 JR