Short: MicroPython interpreter for Amiga68k Author: Fabrice LABATUT Uploader: fabrice labatut club-internet fr Type: dev/lang Version: 1.28.0-build239 Replaces: dev/lang/micropython.lha Requires: 2 MB RAM (4 MB recommended for networking/TLS) Architecture: m68k-amigaos >= 3.0 Distribution: Aminet URL: https://github.com/OoZe1911/micropython-amiga-port MicroPython for AmigaOS (m68k) ============================== A port of MicroPython v1.28 (compatible Python 3.4) to AmigaOS, targeting Motorola 68020+ processors. Runs on classic Amiga hardware (A1200, A3000, A4000) and emulators (WinUAE, FS-UAE). This port was developed by Fabrice with coding assistance from Claude (Anthropic's AI), under Fabrice's direct supervision: architecture decisions, implementation strategy, testing on real hardware/emulator, and bug reports are all driven by Fabrice. Every change is reviewed and validated before being committed. Requirements ------------ - AmigaOS 3.0 or higher - Motorola 68020 CPU or higher - 2 MB RAM minimum for simple scripts - 4 MB RAM recommended for networking and TLS - AmiSSL (optional, required for HTTPS/TLS support) Usage ----- micropython ; interactive REPL micropython script.py ; run a Python script micropython script.mpy ; run precompiled bytecode micropython -c "print(2**32)" ; run inline code micropython -m 512 script.py ; run with 512 KB heap The default heap size is 128 KB. Use -m to allocate more memory (in KB). For example, downloading a web page may require 4 MB of heap: micropython -m 4096 script.py Press Ctrl-C at any time to interrupt a running script or a time.sleep() call. Features -------- Core Python - Full Python 3.4 compatibility (ROM_LEVEL_EVERYTHING): f-strings, set operations, OrderedDict, advanced slicing, descriptors, async/await - Interactive REPL with readline support (cursor keys, history) - Script execution, inline code (-c), configurable heap (-m) - Precompiled bytecode: import and run .mpy files compiled with mpy-cross, or run them directly (micropython script.mpy) - Ctrl-C (KeyboardInterrupt) during scripts, loops, time.sleep() - input() builtin, sys.stdin/stdout/stderr streams Modules - re, json, math, struct, binascii, base64, time, datetime, random, hashlib (sha256), errno, platform, socket, ssl, urequests, smtplib, email, deflate, gzip, zlib, zipfile, arexx, gc, sys, io Filesystem - Full open/read/write/close via VFS_POSIX - os.listdir, getcwd, chdir, mkdir, rmdir, remove, rename, stat, chmod, getprotect, setprotect, makedirs, walk, getenv, putenv, unsetenv - os.path with AmigaOS volume:path conventions Networking - TCP/UDP sockets, DNS resolution via bsdsocket.library - urequests HTTP client: HTTP/1.1, chunked encoding, gzip - HTTPS via AmiSSL (requires amissl.library on the Amiga) - smtplib + email: send email via SMTP/SMTPS/STARTTLS with MIME multipart, attachments, RFC 2047 headers (UTF-8) AmigaOS native - amiga.intuition: native modal requesters via intuition.library -- easy_request(title, body, buttons) generic dialog -- auto_request(body, yes, no) yes/no confirmation -- message(body, button) single-button notice - amiga.asl: native file requester via asl.library -- file_request(**kwargs) with save mode, multi-select, pattern filter, drawers-only mode - arexx: send(), exists(), ports(), Port() persistent client for IPC with AmigaOS applications (IBrowse, Directory Opus...) - platform.amiga_info(): CPU, FPU, chipset, Kickstart, memory All Amiga modules are Latin-1 aware and handle UTF-8/Latin-1 conversion transparently. AmigaOS Path Conventions ------------------------ AmigaOS uses ":" to separate volumes from paths and "/" for subdirectories: >>> import os >>> os.getcwd() 'DH0:Work' >>> os.path.join("DH0:", "work", "scripts") 'DH0:work/scripts' >>> os.path.isabs("DH0:file.py") True Release history --------------- Build 239 - New modules smtplib and email: send email via SMTP servers with TLS support (STARTTLS or implicit SSL), MIME multipart messages with UTF-8 content, attachments, and RFC 2047 header encoding for non-ASCII subjects. - CPython-compatible API (smtplib.SMTP, smtplib.SMTP_SSL, email.mime.text.MIMEText, email.mime.multipart.MIMEMultipart, email.mime.application.MIMEApplication, email.header.Header). Build 237 - New module amiga.asl: native file requester via asl.library. file_request() supports save mode, multi-select (returns list[str]), pattern filter, and drawers-only mode. Build 234 - New module amiga.intuition: modal Workbench requesters via intuition.library's EasyRequest. Three functions: easy_request() for custom dialogs, auto_request() for yes/no confirmations, message() for single-button notices. Build 230 - Rebased on MicroPython 1.28: PEP 750 template strings, nested f-strings, updated event-waiting API. - Fix: Ctrl-C during a blocking socket call (accept, recv, connect, send, sendto, recvfrom) no longer crashes the VM. Build 227 - Full Latin-1 <-> UTF-8 round-trip for filenames and terminal output. Accented characters now work transparently in os.listdir, open, and print. Build 219 - Fix: m68k alignment crash on for loops, list comprehensions, unpacking, and builtins (sum, min, max, sorted). - Fix: arexx.send() now interruptible by Ctrl-C. - Various stability fixes (SSL fd, inet_ntoa, locale caching). Build 209 - Environment variables: os.getenv, os.putenv, os.unsetenv. - New modules: zlib, zipfile. - Timezone support via locale.library; strftime in time and datetime. - input(), sys.stdin/stdout/stderr. - os.chmod accepts Unix-style modes (0o755, etc.). Build 186 - First ARexx IPC module. - Ctrl-C in scripts and time.sleep(). - Direct .mpy execution from command line. Build 169 - Initial release. Known Limitations ----------------- - time.ticks_ms() returns 0 (no high-res timer yet) - hashlib only supports SHA256 - Sockets are always blocking - No multithreading - re module: {n} quantifiers are not supported (use explicit repeated characters instead, e.g. "..." instead of ".{3}") Source Code ----------- The full source code is available on GitHub: https://github.com/OoZe1911/micropython-amiga-port Latest build can be downloaded here: https://github.com/OoZe1911/micropython-amiga-port/blob/main/ports/amiga/build/micropython License ------- MicroPython is licensed under the MIT License.