You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This doesn't seem to be explained very well. My understanding is that you can
import hy in a Python script and then import modules written in Hy. Naturally, Hy must have been installed for this to work.
create a Python module foo with an __init__.py that does the import hy, and then just import foo. (Hy must still have been installed. I think.)
compile with hyc and get a normal .pyc file. Import said .pyc. Does this still work? Do you have to install Hy too, or does the .pyc include that?
I didn't see any of this in the docs.
What if I want to eval (exec?) a string containing Hy code? Is there a way to do that from Python? Or can you only import? Can I launch a Hy repl from Python's? These capabilities are important for supporting doctest #1019. If these capabilities exist, they should be documented. If not, they should be added.
The text was updated successfully, but these errors were encountered:
compile with hyc and get a normal .pyc file. Import said .pyc. Does this still work?
Yes, it does.
Do you have to install Hy too, or does the .pyc include that?
Usually, you will need Hy, because if you use any of a variety of Hy's builtins, an approriate import statement will be added to the top of the generated Python code.
This doesn't seem to be explained very well. My understanding is that you can
import hy
in a Python script and then import modules written in Hy. Naturally, Hy must have been installed for this to work.foo
with an__init__.py
that does theimport hy
, and then justimport foo
. (Hy must still have been installed. I think.)hyc
and get a normal.pyc
file. Import said.pyc
. Does this still work? Do you have to install Hy too, or does the.pyc
include that?I didn't see any of this in the docs.
What if I want to
eval
(exec
?) a string containing Hy code? Is there a way to do that from Python? Or can you onlyimport
? Can I launch a Hy repl from Python's? These capabilities are important for supporting doctest #1019. If these capabilities exist, they should be documented. If not, they should be added.The text was updated successfully, but these errors were encountered: