hy/bin/hython

29 lines
638 B
Plaintext
Raw Normal View History

2012-12-19 01:02:50 +01:00
#!/usr/bin/env python
2012-12-19 01:24:10 +01:00
# -*- coding: utf-8 -*-
2012-12-19 01:02:50 +01:00
from hy.lang.importer import _hy_import_file
2012-12-19 01:24:10 +01:00
from code import InteractiveConsole
2012-12-29 16:56:45 +01:00
import traceback
2012-12-19 01:02:50 +01:00
import sys
2012-12-29 16:56:45 +01:00
2012-12-28 23:57:16 +01:00
try:
import readline
except ImportError:
pass
2012-12-19 01:02:50 +01:00
2012-12-19 01:24:10 +01:00
if len(sys.argv) > 1:
2012-12-19 05:44:44 +01:00
sys.argv = sys.argv[1:]
2013-01-01 02:51:18 +01:00
mod = _hy_import_file(sys.argv[0], '__main__')
2012-12-19 01:24:10 +01:00
sys.exit(0)
InteractiveConsole().interact(banner="""
"Really, if the lower orders dont set us a good example, what on
earth is the use of them?"
-- Oscar Wilde (The Importance of Being Earnest)
The hython bits have been loaded -- magically, .hy
files are importable!""")