How to load current buffer into interpreter in emacs?

Discussion in 'Python' started by cnb, Sep 16, 2008.

  1. cnb

    cnb Guest

    I'm trying to switch to using emacs for python.

    The interpreter and python-mode works but I can't load the file I'm
    editing into the interpreter.

    im not sure if c-c c-l is supposed to do that but it complains "no
    module xxxx" .

    what needs to be in my emacs-path?

    what needs to be in my windows path?

    I have c:/python25. adding that tot he path ads everything inside
    python25? i have my programs in:
    c:/python25/progs/
    in which i have /progdir/someprog.py for example
    cnb, Sep 16, 2008
    #1
    1. Advertising

  2. On 16 Sep, 14:01, cnb <> wrote:
    > I'm trying to switch to using emacs for python.
    >
    > The interpreter and python-mode works but I can't load the file I'm
    > editing into the interpreter.


    I'm using emacs to edit and run python programs on windows. In
    my .emacs I have the following line:

    (setq python-python-command "C:\\python25\\python.exe")

    And it works.

    Another alternative is to set the environment variable PYTHONPATH to
    point to the location of the python interpreter, but then you also
    need to edit the .../lisp/progmodes/python.el file to use semicolon
    (instead of colon) as a path separator. (in emacs 22.1 it is in line
    1354 of the file (search for PYTHONPATH).

    (Or perhaps you needed to that anyway... I'm not sure).

    Good luck
    Niklas Norrthon
    Niklas Norrthon, Sep 16, 2008
    #2
    1. Advertising

  3. cnb

    cnb Guest

    i can run the interpreter. its just i cant load a file into it.

    i tried adding your suggestion but it didnt help. i dont think thats
    the issue though.
    cnb, Sep 16, 2008
    #3
  4. On 16 Sep, 15:27, cnb <> wrote:
    > i can run the interpreter. its just i cant load a file into it.
    >
    > i tried adding your suggestion but it didnt help. i dont think thats
    > the issue though.


    Start the interperter (Menu Python - Start interpreter)
    Emacs split the frame in two windows
    Place the cursor in the python file (C-x o) if necessary
    Eval Buffer (C-c C-c)

    Niklas Norrthon
    Niklas Norrthon, Sep 16, 2008
    #4
  5. cnb

    cnb Guest

    On Sep 16, 3:36 pm, Niklas Norrthon <>
    wrote:
    > On 16 Sep, 15:27, cnb <> wrote:
    >
    > > i can run the interpreter. its just i cant load a file into it.

    >
    > > i tried adding your suggestion but it didnt help. i dont think thats
    > > the issue though.

    >
    > Start the interperter (Menu Python - Start interpreter)
    > Emacs split the frame in two windows
    > Place the cursor in the python file (C-x o) if necessary
    > Eval Buffer (C-c C-c)
    >
    > Niklas Norrthon



    ok so C-c C-l is just for doing import, not loading current file?

    When I do C-c C-c nothing happens at all.
    cnb, Sep 16, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rex Eastbourne

    Running Python interpreter in Emacs

    Rex Eastbourne, Jun 23, 2005, in forum: Python
    Replies:
    12
    Views:
    756
    Rex Eastbourne
    Jul 2, 2005
  2. Sells, Fred

    RE: Running Python interpreter in Emacs

    Sells, Fred, Jun 27, 2005, in forum: Python
    Replies:
    0
    Views:
    407
    Sells, Fred
    Jun 27, 2005
  3. cnb
    Replies:
    0
    Views:
    270
  4. ssecorp
    Replies:
    0
    Views:
    101
    ssecorp
    Sep 1, 2008
  5. Adam Funk
    Replies:
    4
    Views:
    232
    Adam Funk
    Jan 29, 2007
Loading...

Share This Page