Porting Python 3 to the QL

Tell us about your other hobbies & none QL related items here :)
User avatar
Forum Moderator
Posts: 1585
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK

Porting Python 3 to the QL

Postby NormanDunbar » Wed Apr 15, 2020 8:03 am

Morning ql_freak,

Continued from viewtopic.php?f=9&t=3231 as the subject isn't related to the content!

porting Python 3 to the QL will most likely not be possible. I looked into it a while back. Even porting 2.7 or any of the 2.x versions, as far as I remember, will not be possible because there is "something" that is needed to do the port, that the QL doesn't have. It's Python! Much of the Python build nowadays is built with Python - if I remember correctly.

I think the oldest versions were written in plain C, which might have ported, but those are not available now (and are too out of date) so it's a non starter. :(

If I have time during a coffee break today, I'm still working - apparently, I'm essential - I'll see if I can flesh out the ramblings above with some facts. Otherwise I'm about as useful as Donald Trump. (Who by the way, is not circumcised. He's a complete prick! :D :D :D )


Why do they put lightning conductors on churches?
Author of Arduino Software Internals - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890
User avatar
Font of All Knowledge
Posts: 2163
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Porting Python 3 to the QL

Postby tofro » Wed Apr 15, 2020 8:26 am


there's µPython, an implementation for microcontrollers, which is fully written in C, optimized for "constrained environments" (that sounds familiar...) and would be a good candidate for a port if someone invested the time.


and: don't - ever - compare yourself with DT - That's the start of a very serious inferiority complex :D

ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Font of All Knowledge
Posts: 2323
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: Porting Python 3 to the QL

Postby Derek_Stewart » Wed Apr 15, 2020 10:45 am


I downloaded the current stable version, Python 3.7.7

I compiled the source on my Linux laptop, which compiled okay and installed it to my system.

I looked at the source code to Python 3.7.7 which looks like C source code to me and referring to the Python Developers documentation, in the section pertaining to porting to another operating system. The test indicates that the makefile is required to be changed to suit the target operating system.

So I think Python is portable with C68, just needs the makefile and configuration files ammended to suit the QL.

This sounds easy, but I have been struggling with this for a while. Looks like back to studying the MAKE documentation.

Maybe another idea would be write a Python library to run Superbasic files in Python.


User avatar
Brittle Membrane
Posts: 106
Joined: Fri Nov 24, 2017 8:43 am

Re: Porting Python 3 to the QL

Postby Artificer » Sat Apr 18, 2020 2:56 pm


I like Python and have found it easy to use on the RPi - I used it to create a python script to input files via the serial port from my QL system and pass them to CUPs for printing.

At the moment I can print text files and html files directly from the QL to the printer via the RPi and CUPS. What I found when writing the script is that Python often needs bespoke libraries imported for the interpreter in many scripts so developing a python interpreter for the Q68 could involve the creation of equivalent smsq/e libraries to run many of the scripts that exist out there.

I think that there would be an immense amount of support work to maintain a Q68 python implementation capable of making use of available python scripts.

So to get away from the negative I could see that it might be possible to create a conversion program that converts superbasic to Python to run QL programs natively on other systems a bit like CPORT


Who is online

Users browsing this forum: No registered users and 2 guests