swiftonpython là một thư viện Python giúp thực thi mã Swift từ Python, tích hợp linh hoạt để bạn có thể chạy mã Swift mà không cần biên dịch .so riêng biệt. Chỉ cần cài đặt và sử dụng ngay trong dự án Python.
Cài Đặt: Đảm bảo rằng bạn đã cài đặt Swift và có thể truy cập từ dòng lệnh.
Cài đặt thư viện từ PyPI:
Link github: https://github.com/bobbyshop-vui/swiftonpython
pip install swiftonpython
Sử Dụng: Sau khi cài đặt, bạn chỉ cần import thư viện và thực thi mã Swift trực tiếp từ Python.
Ví dụ sử dụng:
import swiftonpython
# Mã Swift bạn muốn chạy
swift_code = """
print("Hello from Swift!")
"""
# Gọi hàm để thực thi mã Swift
swiftonpython.swiftonpython(swift_code)
Vậy là xong! Mã Swift sẽ được thực thi trực tiếp trong môi trường Python mà không cần phải cấu hình phức tạp.
Metadata
Release files for swiftonpython 0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swiftonpython-0.8.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swiftonpython-0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.6 kB
Release files / swiftonpython-0.8.tar.gz
| Download URL | swiftonpython-0.8.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
548009546c996f83abb4d0ae6421e36310a84be209989c0f4bc575b8a1d969f6
|
|
BLAKE2b-256 checksum How to use checksums |
bd20e60680168ea242d8c4506e230f2b6dfcd31cbd8f195cf731b637c042fd05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.6
|
Release files / swiftonpython-0.8-py3-none-any.whl
| Download URL | swiftonpython-0.8-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f26392e7e42a0b4ea164ed79beb685cd880423e2e6c01fb4414c4432a504175
|
|
BLAKE2b-256 checksum How to use checksums |
499c74d67ba769d6f871691e0e09d5886015defdf79e1c3ade2ce3c02675d31e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.6
|