bethany-lcl
Python bindings for the Lazarus LCL (Lazarus Component Library), with an API similar to C++Builder. Part of Bethany, which also provides the same API for C++ and a visual form designer for VS Code.
pip install bethany-lcl
The distribution name is bethany-lcl, and the module name is beth.
Preview. Bethany is at version 0.x. The API may change between minor versions. Only Windows x64 is supported for now.
Example
from beth import *
class TForm1(TForm):
def __init__(self, AOwner):
super().__init__(AOwner)
self.Caption = "Hello"
self.Button1 = TButton(self)
self.Button1.Parent = self
self.Button1.Caption = "OK"
self.Button1.OnClick = self.Button1Click
def Button1Click(self, Sender):
self.Caption = "Clicked"
Application.Initialize()
Form1 = Application.CreateForm(TForm1)
Application.Run()
Classes, properties and events have the same names as in C++Builder and the LCL (TForm, TButton, Caption, OnClick and so on).
The differences from C++ are:
- Arguments passed by reference in C++ (
int& Key,bool& CanClose,TCloseAction& Action, ...) areRefobjects. Read and write them with.value. Application->CreateForm(&Form1)isForm1 = Application.CreateForm(TForm1).- Objects you create yourself (
TStringList,TBitmap,TPicture, ...) are destroyed withFree(), or when no reference to them remains. - Using a wrapper after its LCL object has been destroyed raises
ReferenceError. - Exceptions raised in the LCL are
BethError(E.Message,E.ClassName()).
Designing forms
Bethany Designer is a VS Code extension to design forms on a canvas and generate the Python (or C++) code for them.
License
Bethany is distributed under the MIT License. The package contains beth.dll, which is built with Free Pascal and statically contains
the Free Pascal run-time library and the LCL. They are distributed under the LGPL with a static linking exception.
See THIRD-PARTY-NOTICES.md and the licenses folder in the package metadata, or the
repository.
日本語
Lazarus の LCL を、C++Builder に似た API で Python から使うためのパッケージです。pip install bethany-lcl で入れ、from beth import * で使います。
今のところ Windows x64 だけに対応しています。C++ 版と、フォームを画面で設計する VS Code 拡張は Bethany のリポジトリを参照してください。
Metadata
Release files for bethany-lcl 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bethany_lcl-0.3.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for bethany_lcl-0.3.0-py3-none-win_amd64.whl |
Release files / bethany_lcl-0.3.0-py3-none-win_amd64.whl
| Download URL | bethany_lcl-0.3.0-py3-none-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
73a9ff82b64300c651a802e27a01e6e4545dd41b93eaacb1d47eb7878edcefe4
|
|
BLAKE2b-256 checksum How to use checksums |
2ed430645d2623da82f81af0db13c18815e04114d0f64db7c6c27238d145ecfc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.1
|
Security for bethany-lcl 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.