[python-on-lisp-devel] little modify and extension of pythononlisp

Niitsuma Hirotaka hirotaka.niitsuma at gmail.com
Wed Feb 3 06:29:26 UTC 2010


I write little modify and extension of pythononlisp

http://www2s.biglobe.ne.jp/~niitsuma/pythononlispex.html

usage

(asdf-install:install
"http://www2s.biglobe.ne.jp/~niitsuma/pythononlisp-ex06.tar.gz")
(asdf:operate 'asdf:load-op :pythononlisp)
(py::py "print \"Hello from python\"")

 (py::pyj "numpy.reshape" (list 1 2 3 4 5 6 ) (list 2 3)) ; -> ((1 2
3) (4 5 6))
(py::pyj "numpy.dot" '((1 2) (3 4)) '((1 2) (3 4)) ) ; -> ((7 10) (15 22))

(print (py::pyj "len" (list 1 5 6 ) ) ) ;3
(print (py::pyj "range" 2 7)) ;(2 3 4 5 6)
(py::setvalj "a" (list 2 3 4))
(py::py "print a") ;[2, 3, 4]
(print (py::getvalj "a")) ;(2 3 4)

(py::py "import numpy")
(py::py "xd=numpy.linalg.norm([6,5])")
(py::py "print xd") ;7.81024967591




More information about the python-on-lisp-devel mailing list