Python Starter
Created at 2016-03-22T16:25:21.000Z

My first pyton program is for 2d animation plot.

$ python3
>>> help([])
Help on list object:

class list(object)
 |  list() -> new empty list
 ...
>>> i = 10
>>> dir(i)
[..., '__neg__', ...]
>>> i.__neg__()
-10
>>> type(i)
<class 'int'>

Emacs Integration (using python-mode)

  • Commands
    • C-c C-p: run python interpreter
    • C-c C-c: load current buffer in python interpreter
    • C-c C-l: load current file in python interpreter
    • C-c C-r: load region ...
    • C-c C-s: load string ...
    • C-c C-z: show interpreter
  • NOTE:
    • /usr/bin/python is used for inf-process by default. so it needs to be changed when you use python3 or ipython. Here is my emacs config:
(add-hook 'python-mode-hook (lambda ()
                              (setq python-shell-interpreter "python3"
                                    python-shell-interpreter-args "-i")
                              (setq python-indent-guess-indent-offset nil)
                              (flycheck-mode)))