Can I run a python program from within emacs?

Discussion in 'Python' started by Robinson, Nov 1, 2009.

  1. Robinson

    Robinson Guest

    I have also just started with both Aquamacs and Python so I ask for
    your patience as well.
    When I evaluate the buffer (C-c C-C) I don't see any response or
    output from my python program. Should another buffer open
    automatically? Should a terminal window open?
    thanks for your patience.
    Rugbeia Floreat Ubique

    > On Mar 20, 3:09 pm, jmDesktop <needin4mat... at gmail.com> wrote:
    > > Hi, I'm trying to learn Python. I using Aquamac an emac
    > > implementation with mac os x. I have a program. If I go to the
    > > command prompt and type pythong myprog.py, it works. Can the

    > program
    > > be run from within the editor or is that not how development is

    > done?
    > > I ask because I was using Visual Studio with C# and, if you're
    > > familiar, you just hit run and it works. On Python do I use the
    > > editor for editing only and then run the program from the command
    > > line? Thank you.

    >
    > Aquamacs, just like any variant of GNU Emacs, will show a Python
    > menu. There's a "Start Interpreter" function, and one to evaluate the
    > buffer (C-c C-c). It's pretty straightforward (a euphemism for
    > obvious).
    >
    > If the Python menu doesn't show, then something is going wrong. M-x
    > python-mode RET would switch it on.
    >
    >
    > --
    > http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
    > http://aquamacs.org/donate -- Could we help you? Return the favor and
    > support the Aquamacs Project!
    Robinson, Nov 1, 2009
    #1
    1. Advertising

  2. Robinson

    rustom Guest

    On Nov 1, 7:20 pm, Robinson <> wrote:
    > I have also just started with both Aquamacs and Python so I ask for  
    > your patience as well.
    > When I evaluate the buffer (C-c C-C) I don't see any response or  
    > output from my python program. Should another buffer open  
    > automatically? Should a terminal window open?
    > thanks for your patience.
    > Rugbeia Floreat Ubique
    >
    > > On Mar 20, 3:09 pm, jmDesktop <needin4mat... at gmail.com> wrote:
    > > > Hi, I'm trying to learn Python.  I using Aquamac an emac
    > > > implementation with mac os x.  I have a program.  If I go to the
    > > > command prompt and type pythong myprog.py, it works.  Can the  

    > > program
    > > > be run from within the editor or is that not how development is  

    > > done?


    There are two python modes -- python.el and python-mode.el
    Default with emacs is python.el, what comes from/with python is python-
    mode.el (needs a download and a couple of lines of setup see
    http://www.emacswiki.org/emacs/PythonMode). I recommend python-mode.

    The key-bindings are different --C-c ! to start interpreter followed
    by C-c C-c to exec a file.
    rustom, Nov 1, 2009
    #2
    1. Advertising

  3. Robinson

    Jean Guest

    On Nov 1, 10:15 am, rustom <> wrote:
    > On Nov 1, 7:20 pm, Robinson <> wrote:
    >
    > > I have also just started with both Aquamacs and Python so I ask for  
    > > your patience as well.
    > > When I evaluate the buffer (C-c C-C) I don't see any response or  
    > > output from my python program. Should another buffer open  
    > > automatically? Should a terminal window open?
    > > thanks for your patience.
    > > Rugbeia Floreat Ubique

    >
    > > > On Mar 20, 3:09 pm, jmDesktop <needin4mat... at gmail.com> wrote:
    > > > > Hi, I'm trying to learn Python.  I usingAquamacan emac
    > > > > implementation with mac os x.  I have a program.  If I go to the
    > > > > command prompt and type pythong myprog.py, it works.  Can the  
    > > > program
    > > > > be run from within the editor or is that not how development is  
    > > > done?

    >
    > There are two python modes -- python.el and python-mode.el
    > Default with emacs is python.el, what comes from/with python is python-
    > mode.el (needs a download and a couple of lines of setup seehttp://www.emacswiki.org/emacs/PythonMode). I recommend python-mode.
    >
    > The key-bindings are different --C-c ! to start interpreter followed
    > by C-c C-c to exec a file.


    Perfect! Many thanks...
    Jean, Nov 3, 2009
    #3
    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. pradeep nair
    Replies:
    2
    Views:
    533
  2. jmDesktop
    Replies:
    15
    Views:
    463
  3. frankrentef

    Run program from within Python

    frankrentef, Aug 6, 2008, in forum: Python
    Replies:
    3
    Views:
    358
    frankrentef
    Aug 6, 2008
  4. Robinson
    Replies:
    0
    Views:
    364
    Robinson
    Nov 1, 2009
  5. Adam Funk
    Replies:
    4
    Views:
    217
    Adam Funk
    Jan 29, 2007
Loading...

Share This Page