3

I am new to emacs and I am trying to set python3 as default interpreter. I have installed from software centre the python plugin for emacs.

I can run a python3 file going to pyexec-->execute file...-> python3 file and in a similar way I can run a region of code pyexec-->execute region-> execute region python3

I would like to execute python3 file and region using keyboard short cut

In particular i need something to run all the file and something to run the lightened region of code

1 Answer 1

3

Set py-shell-name to python3, for example by using

Meta+x customize-variable Returnpy-shell-name

6
  • thanks for answer but I am very new to emacs. Can you explain a little better? What is the value of customize-variable and after return should I write python3 or py-shell-name?
    – Donbeo
    Apr 7, 2014 at 17:17
  • Press Meta-x, then Emacs will ask you for a command to run. Type customize-variable. Now Emacs will ask you for a variable to customize. Type py-shell-name. Emacs will open a Custom buffer where you can change the value for Py Shell Name. Change it to python3 and klick the Apply and Save button. Apr 7, 2014 at 17:29
  • when I type py-shell-name I receive a no match message and nothing else
    – Donbeo
    Apr 7, 2014 at 17:35
  • ok it is partially working I have been able to follow your instruction after that I opened a python file. The problem is that now the command C-c l that was previously used to run a region of code in python 2.7 do not work anymore. I would like to use the command C-c l to run a region of code in python3 shell
    – Donbeo
    Apr 7, 2014 at 17:40
  • By default "Execute Region" is bound to C-c | (pipe key) not C-c l (lower case L). Customizing py-shell-name shouldn't change the keyboard bindings. Apr 7, 2014 at 17:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .