Can I run a python program from within emacs?

View: New views
5 Messages — Rating Filter:   Alert me  

Can I run a python program from within emacs?

by Robinson-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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!







--
http://mail.python.org/mailman/listinfo/python-list

Re: Can I run a python program from within emacs?

by jasonsewall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Nov 1, 2009 at 9:20 AM, Robinson <WanderingAengus@...> 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?

I don't know much about Aquamacs or the version of Emacs the Aquamacs
you are using is based on, but the C-c C-c command runs
py-execute-buffer. Try M-x py-execute-buffer <RET> and see what
happens. It should pop up a *Python Output* buffer, unless you're
actually running the python interpreter in Emacs, in which case the
code is run in that buffer.

If you're still having trouble, probably an Emacs or Aquamacs list is
a better place to look.

Jason
--
http://mail.python.org/mailman/listinfo/python-list

Parent Message unknown Re: Can I run a python program from within emacs?

by rpm13 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Nov 1, 7:20 pm, Robinson <WanderingAen...@...> 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.


--
http://mail.python.org/mailman/listinfo/python-list

Re: Can I run a python program from within emacs?

by Robinson-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jason,
Thanks, but I have already tried your suggestions (which seem like  
logical cause/effect actions) and nothing.  There must be a python  
preference or something I haven't set correctly.

There is no Aquamacs list, but I'll check further.

Thanks again for the quick reply.


On Nov 1, 2009, at 9:15 AM, Jason Sewall wrote:

> On Sun, Nov 1, 2009 at 9:20 AM, Robinson  
> <WanderingAengus@...> 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?
>
> I don't know much about Aquamacs or the version of Emacs the Aquamacs
> you are using is based on, but the C-c C-c command runs
> py-execute-buffer. Try M-x py-execute-buffer <RET> and see what
> happens. It should pop up a *Python Output* buffer, unless you're
> actually running the python interpreter in Emacs, in which case the
> code is run in that buffer.
>
> If you're still having trouble, probably an Emacs or Aquamacs list is
> a better place to look.
>
> Jason

--
http://mail.python.org/mailman/listinfo/python-list

Re: Can I run a python program from within emacs?

by Robinson-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Nov 1, 10:15 am, rustom <rustompm...@...> wrote:

> On Nov 1, 7:20 pm, Robinson <WanderingAen...@...> 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...
--
http://mail.python.org/mailman/listinfo/python-list