LoginSignup
6
3

More than 5 years have passed since last update.

Pymacs helloworld

Last updated at Posted at 2016-11-17

~/Documents/elisp/test/Pymacs/helloworld.py
として以下のファイルを保存

~/Documents/elisp/test/Pymacs/helloworld.py
# -*- coding: utf-8 -*-
from Pymacs import lisp

def hello():
    lisp.insert("Hello from Python!")

def hello2(l):
    return l[0]+"pypy123"

def hello3(l):
    return [l[0]+"12pypy123",l[1]+"bbb"]

elisp上で以下を実行

pymacs-test-load.el
(eval-after-load "pymacs" 
'(add-to-list 'pymacs-load-path "~/Documents/elisp/test/Pymacs/"))

(pymacs-load "helloworld")

scratch
などで以下を実行

pymacs-test-do.el
(helloworld-hello)

(helloworld-hello2 "aaa")
;;return "apypy123"

(helloworld-hello3 (list "aaa" "kkk"))
;;return  ("aaa12pypy123" "kkkbbb")
6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3