python - 如何在 Hy 中构建 Python 模块?

标签 python lisp hy

我想使用 Hy ,一种基于 Python 的 Lisp 方言。然而,我的同事都使用 Python,并且不太可能很快切换到 Lisp 方言。

如何将 Hy 代码打包到标准 Python 模块中?

最佳答案

您有三个基本选项。

  1. 如 dg123 所写,让您的同事导入 hy。

  2. 使用 python 包并在你的包 __init __.py 文件中自己导入 hy。然后,您的同事只需导入您的模块即可。

  3. 使用 hyc 编译您的模块并部署您的同事可以导入的 .pyc 文件作为普通 python 模块。

关于python - 如何在 Hy 中构建 Python 模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23317994/

相关文章:

python - 使用python(robobrowser)下载图片和pdf

python - 无法使用 Python 的 nfcpy 库将 Type2Tag 格式化为 NDEF

python - 如何用matplotlib控制彩色图像渲染?

emacs - 如何为 Emacs 修复损坏的 Lisp 目录路径?

hy - 不存在的 hy 宏运行断言,但其他一切都会失败

python - tensorflow 概率: Gradients always zero when backpropagating the log_prob of a sample of a normal distribution

scheme - 实现方案 if 子句仅使用避孕套

lisp - Common Lisp 可以做什么?

python - 用 Hy 中的索引替换列表/字典元素