cyberlang-0.6.3
توضیحات
A self-contained Cyber intepreter
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | cyberlang-0.6.3 |
| نام | cyberlang |
| نسخه کتابخانه | 0.6.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | David Kincaid |
| ایمیل نویسنده | dlkincaid0@gmail.com |
| آدرس صفحه اصلی | https://github.com/DaelonSuzuka/cyber-python |
| آدرس اینترنتی | https://pypi.org/project/cyberlang/ |
| مجوز | MIT |
# cyberlang - batteries included python bindings for cyber
[](./LICENSE)
[](https://pypi.org/project/cyberlang/)
[](https://github.com/qtstrap/qtstrap)
[](https://discord.gg/Ky8vNZJvAT)
## Installation
```
pip install cyberlang
```
## Usage
Simply create a CyberVM instance and evaluate a string:
```py
from cyber import CyberVM
vm = CyberVM()
vm.eval("print 'hello world!'")
```
Want to capture printed output? Override the `print` function from Cyber's `core` module with a binding.
The decorator generates all the required wrappers and interfaces, and registers everything with Cyber's VM.
```py
from cyber import CyberVM
vm = CyberVM()
@vm.function('core.print')
def _print(string: str):
print(string)
vm.eval("print 'hello world!'")
```
Alternate techniques for creating callback functions:
```py
# if no module, assume core
# same result as previous example
# this creates function "print2" in the "core" module
@cyber.function('print2')
def _print2(string: str):
print(string)
# if no module, assume core
# if no function name, use existing function name
# this creates function "test" in the "core" module
@cyber.function
def test():
print('core.test')
```
Or define multiple functions at once using this class-based syntax
```py
# "core" already exists, so add a() and b() to it
class Core(cyber.module('core')):
def a(self):
print('core.test')
def b(self):
print('core.test2')
# create "new_module" and add c() and d() to it
@cyber.module('new_module')
class Module:
def c(self):
print('new_module.test')
def d(self):
print('new_module.test2')
# create module, implicitly named "NewModule" and add e() and f() to it
@cyber.module
class NewModule:
def e(self):
print('NewModule.test')
def f(self):
print('NewModule.test2')
```
# Supporters
[fubar](https://github.com/fubark) - creator of the Cyber language
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl cyberlang-0.6.3:
pip install cyberlang-0.6.3.whl
نصب پکیج tar.gz cyberlang-0.6.3:
pip install cyberlang-0.6.3.tar.gz