Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Has anyone tried to use IPython with the Hylang syntax?

Tags:

python

ipython

You can use Hylang with this magic:

In [1]: %%script hy
(print "Hello, Cuddlefish!")                                                                                             
   ...: 
=> Hello, Cuddlefish!
=> hy 0.9.12


In [2]: 

I want to use it directly:

In [1]: (print "Hello, Cuddlefish!")
Hello, Cuddlefish!

Int [2]:
like image 394
Yuval Langer Avatar asked Jan 19 '14 16:01

Yuval Langer


People also ask

Is IPython still used?

By default, this was Python. The IPython console is now deprecated and if you want to start it, you'll need to use the Jupyter Console, which is a terminal-based console frontend for Jupyter kernels.

How do I run IPython from command prompt?

Install IPython The easiest way is to run easy_install ipython[all] as an administrator (start button, type cmd , shift+right click on “cmd.exe” and select “Run as administrator”). This installs the latest stable version of IPython including the main required and optional dependencies.

Is IPython and Jupyter the same?

The IPython Notebook is now known as the Jupyter Notebook. It is an interactive computational environment, in which you can combine code execution, rich text, mathematics, plots and rich media. For more details on the Jupyter Notebook, please see the Jupyter website.

Is IPython better than Python?

IPython offers an enhanced read-eval-print loop (REPL) environment particularly well adapted to scientific computing. In other words, IPython is a powerful interface to the Python language. But it is certainly not the only one. Besides IPython, the most common way to use Python is to write scripts, files with the .


1 Answers

Try out my hymagic module. You can install it using

$ pip install hymagic

Load the magic using

%load_ext hymagic

Use %hylang for one line and %%hylang for a whole cell. For example

%hylang (+ 1 2 3)

and

%%hylang
(defn hello []
   (print "hello world"))
(hello)
like image 158
yardsale8 Avatar answered Sep 30 '22 20:09

yardsale8