Can I run a python program from within emacs?

Grant Edwards grante at visi.com
Thu Mar 20 12:10:35 EDT 2008


On 2008-03-20, jmDesktop <needin4mation at gmail.com> wrote:

>> I believe Grant was suggesting that Emacs often serves a
>> similar purpose on Unix to what Visual Studio does on Windows,
>> which seemed to be what you were asking.  When asking about
>> Mac OS X here, you are likely to get a lot of generic Unix
>> responses.  (Would it have been clearer if he had just said
>> "emacs?")
>
> No.  Typically when someone posts a one-liner search it means
> go figure it out and stop bothering "us." I had already
> searched.  I could not get it to work,

Could not get what to work?

> which is why I posted.  If I took it wrong I apologize.

I honestly thought you were asking how to run/debug python
programs inside emacs.  A couple of the hits answered that
question.  The others explained how do get python-aware editing
modes configured.

> I really had two questions.  One is just how to run a program from
> within the editor and the other is if my thinking on how development
> is done in python wrong to start with.  Most of my non-Windows
> programs have been on Unix using vi, but it has been a while.  I'm
> used to writing a program in visual studio and running it.

Perhaps you'd be more comfortable with one of the IDEs?

http://wiki.python.org/moin/IntegratedDevelopmentEnvironments
http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#Python

> If that's the wrong expectation for python programming in
> emacs, then I wanted to know.

Yes, you can run programs (including python debuggers) from
inside emacs.  The simplest way is to do "meta-x shell" to get
a shell prompt inside emacs, then just type whatever command
line you want to use to run the program.  Or you can map a
command to a keystroke that will run the program.

I generally just have another terminal window open where I run
the program -- but I've never liked IDEs so your tastes may
differ.

-- 
Grant



More information about the Python-list mailing list