Skip to main content

A Python package to run objc code on python

Project description

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 Foundation framework).
  • 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>"):

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

objconpython-0.3.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

objconpython-0.3-cp39-cp39-macosx_10_9_universal2.whl (7.0 kB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file objconpython-0.3.tar.gz.

File metadata

  • Download URL: objconpython-0.3.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.6

File hashes

Hashes for objconpython-0.3.tar.gz
Algorithm Hash digest
SHA256 4b31317937b9ea55486bff224553507652267fd96ba7ab476c5ee32241980f03
MD5 0e5375061359835dc59096fe3001fb52
BLAKE2b-256 b9c2a53482e270522dfca996d0f683965bd264eee7be6cfb6be57fee062cc958

See more details on using hashes here.

File details

Details for the file objconpython-0.3-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for objconpython-0.3-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 e3e1a91d1748afad356640c72a754073c728d213452c7d6f297084d29bc2b02f
MD5 30fe21001da9e74b950718a382ab1f7f
BLAKE2b-256 6459784e74fb6a4f9e1a8d27381f4bd42a4437aa80e80a423fe07c0d843930c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page