How to load current buffer into interpreter in emacs?

C

cnb

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
 
N

Niklas Norrthon

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
 
C

cnb

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.
 
N

Niklas Norrthon

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
 
C

cnb

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top