Cy Bu
Cy Bu

Reputation: 1437

set init.el file to start-up the python interpreter

On ubuntu 16.04 emacs24 python3.5, I have a simple init.el file as follows:

;; Set what python
(setq elpy-rpc-python-command "python3.5")
(setq python-shell-interpreter "python3.5")

;; Set org mode
(eval-after-load "org"
  '(org-babel-do-load-languages
    'org-babel-load-languages
    '((sh . t)
      (python . t)
      (emacs-lisp . t)
      (ditaa . t)
      ))
  )

;; split windows
;; layout definition
(defun my-startup-layout ()
 (interactive)
 (delete-other-windows)
 (split-window-horizontally) ;; -> |
 (next-multiframe-window)

 (dired "~")
)

;; execute the layout
(my-startup-layout )

However, i would like to be able to run the right window with the python interpreter by default.
How can i do this please?

Upvotes: 0

Views: 263

Answers (1)

Rorschach
Rorschach

Reputation: 32426

You can call run-python in your hook, eg

(defun my-startup-layout ()
  (delete-other-windows)
  (split-window-horizontally)
  (dired "~")
  (run-python nil nil 'show))

(my-startup-layout)

Upvotes: 1

Related Questions