How can I create a Python module in Hy?

I would like to use Hy , a Lisp dialect on top of Python. However, my colleagues use Python and are unlikely to switch to the Lisp dialect in the near future.

How can I pack Hy code in a standard Python module?

+4
source share
2 answers

You have three main options.

  • Import your employees as dg123 wrote.

  • use the python package and import yourself into your __init __.py files. Then your colleagues can simply import your modules.

  • compile your module with hyc and deploy a .pyc file that your colleagues can import as a regular python module.

+5
source

Simple! , pip install hy, .hy Python:

1) hy:

import hy

2) , Python .py:

import module_name

( module_name module_name.hy , Python)

+3

Source: https://habr.com/ru/post/1538232/


All Articles