hy/bin/hy2py
Konrad Hinsen c30a116416 Add "from __future__ import division" to Python code generated by hy2py
This is mainly to make we don't forget this. The current state of hy2py
is more a proof-of-concept than a usable tool anyway.
2013-04-12 08:00:08 +02:00

24 lines
466 B
Python
Executable File

#!/usr/bin/env python
from hy.importer import (import_file_to_ast, import_file_to_module,
import_file_to_hst)
import astor.codegen
import sys
import ast
hst = import_file_to_hst(sys.argv[1])
print hst
print ""
print ""
_ast = import_file_to_ast(sys.argv[1])
print ""
print ""
print ast.dump(_ast)
print ""
print ""
print "from __future__ import division"
print astor.codegen.to_source(_ast)
import_file_to_module("<STDIN>", sys.argv[1])