objconpython - Execute Objective-C Code from Python
This Python package allows you to execute Objective-C code directly within Python using a simple function call. You can use with pyobjc
Features
- Execute inline Objective-C code from Python using
objconpython.run(). - Supports basic Objective-C expressions and code evaluation.
- Handles Objective-C exceptions and returns error messages to Python.
- Easy-to-use integration in Python projects.
Requirements
- macOS (required for Objective-C execution via
Foundationframework). - Python 3.x or higher.
- pip (for installing the package).
Installation
To install the package, run the following command:
pip install objconpython
import objconpython
objc_code = """
#import <Foundation/Foundation.h>
int main() {
@autoreleasepool {
NSLog(@"Hello from Objective-C!");
}
return 0;
}
"""
# Gọi hàm run trong module
result = objconpython.run(objc_code)
print(result)
Explanation: objconpython.run("<objc_code>"):
Metadata
Release files for objconpython 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| objconpython-0.3.tar.gz | 1.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| objconpython-0.3-cp39-cp39-macosx_10_9_universal2.whl | CPython 3.9 | CPython 3.9 | macOS 10.9+ universal2 (ARM64, x86-64) | Details |
Total release size: 9.0 kB
Release files / objconpython-0.3.tar.gz
| Download URL | objconpython-0.3.tar.gz |
|---|---|
| Size | 1.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b31317937b9ea55486bff224553507652267fd96ba7ab476c5ee32241980f03
|
|
BLAKE2b-256 checksum How to use checksums |
b9c2a53482e270522dfca996d0f683965bd264eee7be6cfb6be57fee062cc958
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.6
|
Release files / objconpython-0.3-cp39-cp39-macosx_10_9_universal2.whl
| Download URL | objconpython-0.3-cp39-cp39-macosx_10_9_universal2.whl |
|---|---|
| Size | 7.0 kB |
| Tags | CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
e3e1a91d1748afad356640c72a754073c728d213452c7d6f297084d29bc2b02f
|
|
BLAKE2b-256 checksum How to use checksums |
6459784e74fb6a4f9e1a8d27381f4bd42a4437aa80e80a423fe07c0d843930c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.6
|