Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #43088

Re: Interactive development in Python à la Smalltalk?

From Terry Jan Reedy <tjreedy@udel.edu>
Subject Re: Interactive development in Python à la Smalltalk?
Date 2013-04-08 15:01 -0400
References <b72b1403-ade8-4524-94c3-19043ee64a1f@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.300.1365447679.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 4/8/2013 4:33 AM, Bienlein wrote:
> Hello,
>
> I'm absolutely new to Python, just looked at the language description
> for the first time. The first thought that came to my mind was
> whether you can program  in Python in an interactive programming
> style, i.e. I can change code in the debugger which becomes
> immediately effective (no edit-compile loop) and I can also send
> messages to objects visible inside the debugger.

The CPython interpreter has both a 'batch' mode (run code in a file) and 
an interactive mode (run code typed in response to a prompt). It also 
has a '-i' option to run code in batch mode and then switch to 
interactive mode so one can interrogate visible objects and call functions.

The Idle IDE has editor windows linked to an interactive shell. When you 
run code in the editor window, it saves and runs it with the -i option 
so you can interactive with the results in the Shell. Compiling edited 
text to bytecode is typically so fast (well under a second) as to not be 
an issue.

> Then Python could become my replacemenet for my dearly missed
> Smalltalk, which to my great grief meanwhile really has become quite
> dead, I fear. In Smalltalk you can open up an inspector window (e.g.
> you don't have to get into debug mode), inspect objects in it and
> evaluate code in it, send messaages to objects. I guess this cannot
> be done in Python out of the box. But if changes made in the debugger
> became immediately effective, this would be interactive enough for my
> purposes.

Idle also has a debugger window that does some of that, though it works 
better on non-Windows OSes. I have never actually used it.

---
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Interactive development in Python à la Smalltalk? Bienlein <jeti789@web.de> - 2013-04-08 01:33 -0700
  Re: Interactive development in Python à la Smalltalk? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-08 09:27 +0000
  Re: Interactive development in Python à la Smalltalk? "Colin J. Williams" <cjw@ncf.ca> - 2013-04-08 08:26 -0400
  Re: Interactive development in Python à la Smalltalk? Terry Jan Reedy <tjreedy@udel.edu> - 2013-04-08 15:01 -0400

csiph-web