A different kind of interface

B

bearophileHUGS

I use the Python shell daily, plus of course normal editors to edit
python scripts. They both are very useful for different purposes. But
the default interactive shell isn't much handy if you want to modify
the past code to run it again, or you want to embed a bit of text in
the code, or if you want to produce something a bit more clean that
you can save, or just if you want to edit and debug 7-lines long
programs.

I have tried IPython, but I have never appreciated it too much, maybe
because it requires me to remember too many things (and because on Win
it's probably a little less handy). Probably I need something closer
to an editor and less close to a shell.

In past I have also used the interactive editor of Mathematica (older
versions, but I think its basic usage isn't changed much later), but
despite being quite handy if you want to mix plotting and the editing
of small formulas, I can't appreciate it to write programs more than 3
lines long. It's not a good or handy editor, and it has some other
disadvantages

So I have always tried to think for possible alternative solutions for
an interactive way to use Python. I am not looking for something to
replace the nornal editors used to write long Python programs.

Years ago I have found this nice small program, TextCalc:
http://www.atomixbuttons.com/textcalc/

Despite being very limited and being not integrated with everything
else, it's so handy that for me in certain situations it's the right
tool to use when I have to process numbers and data in simple ways. It
helps me keep all the intermediate solutions, you can save the working
page just as the text file you are seeing, it's "passive", it doesn't
go bang, so if you want you can use it just a primitive text editor.
It does something only when you ask it to. And for a basic usage there
is nearly nothing to remember.

I don't know if this can be any good, but maybe a textcalc-like
interface that (beside having few graphical buttons for normal
operations, and few basic text editing capabilities) allows to use
Python may be a good idea. Probably there are better designs for this
interface, but it's hard to invent them.

If you have ideas I'd like to know them.

Bye,
bearophile
 
B

Bruno Desthuilliers

(e-mail address removed) a écrit :
I use the Python shell daily, plus of course normal editors to edit
python scripts. They both are very useful for different purposes. But
the default interactive shell isn't much handy if you want to modify
the past code to run it again, or you want to embed a bit of text in
the code, or if you want to produce something a bit more clean that
you can save, or just if you want to edit and debug 7-lines long
programs.

I have tried IPython, but I have never appreciated it too much, maybe
because it requires me to remember too many things (and because on Win
it's probably a little less handy). Probably I need something closer
to an editor and less close to a shell.

emacs python-mode is a very powerful combo. Write your code in a buffer,
send it for evaluation to another buffer running a Python shell,
interact with it, switch back to the edit buffer, change your code,
lather, rinse, repeat.
 
B

bearophileHUGS

Ben Finney:
Adding an editor to Python solves this problem only for Python.

I'm sure that once such "editor" (I use the word editor for lack of a
better term) is created, it can also be quickly adapted with other
dynamic languages, like Ruby, TCL, Lua, Io, Perl, Awk, ecc. Probably
it can't be adapted for languages like Java, C++, etc.

Many of us solve this by using a single full-featured programmer's
editor that allows invoking a program +IBQ- written in any of *dozens or
hundreds* of different languages +IBQ- from within the editor.

I don't know what an IBQ is. But I was not talking about a normal
editor. Take a look at TextCalc, for example. I am trying to invent
something that I have not seen so far :)

It's a solution that only requires you to learn one editor interface,

I'm looking for something very easy to use, probably more easy than
the Python shell itself.

The leaders in the field, by far, are GNU Emacs <URL:http://www.gnu.org/software/emacs/emacs.html> and Vim<

I'm probably looking for something based on different ideas.

-------------------

Bruno Desthuilliers:
emacs python-mode is a very powerful combo. Write your code in a buffer,
send it for evaluation to another buffer running a Python shell,
interact with it, switch back to the edit buffer, change your code,
lather, rinse, repeat.<

I am sure that's very useful, but it's not what I am looking for. I am
looking for something that's a bit closer to the Mathematica shell,
but more passive and fitter to edit 10-lines long programs too, and
able to save the cleaned text result of the interaction.

Bye,
bearophile
 
V

Vic Kelson

How about IDLE? It's a nice tool for the Python programmer. I've tried
lots of IDEs, but when it comes down to it, on small-to-medium jobs I
am be very productive indeed using IDLE...

--v
 
D

Doug Morse

How about IDLE? It's a nice tool for the Python programmer. I've tried
lots of IDEs, but when it comes down to it, on small-to-medium jobs I
am be very productive indeed using IDLE...

--v

I find Stani's Python Editor (SPE) also good for small to medium jobs, and I
think that it might achieve many of the OP's objectives.
 
S

Steve Holden

Doug said:
I find Stani's Python Editor (SPE) also good for small to medium jobs, and I
think that it might achieve many of the OP's objectives.
If you just want something small and Python-specific then DrPython is
also a reasonable choice. It uses the Scintilla editor component that is
also used by Scite, another possibility (though personally I find the
bare Scite editor just a little too tweaky to configure).

regards
Steve
 
E

Eduardo O. Padoan

I use the Python shell daily, plus of course normal editors to edit
python scripts. They both are very useful for different purposes. But
the default interactive shell isn't much handy if you want to modify
the past code to run it again, or you want to embed a bit of text in
the code, or if you want to produce something a bit more clean that
you can save, or just if you want to edit and debug 7-lines long
programs.

You are almost *describing* reinteract:
http://blog.fishsoup.net/2007/11/10/reinteract-better-interactive-python/

It is a mix of a shell and an editor, that lets you go back and
rewirte history, and execute it again. It is GTK+, and you can write
plugins to plot graphics or display html, for example.
 
T

Terry Reedy

Since I currently only program in Python, IDLE does fine for me.
Write code, hit F5. If the result is not right, maybe type a few
interactive lines to get more info before going back to the edit window.

Maybe someday I will look to see what alternatives such as below offer,
but if they do not put me in an interactive interpreter or imitation
thereof, like IDLE, to do post-mortem examination in, I would not likely
switch.
If you just want something small and Python-specific then DrPython is
also a reasonable choice. It uses the Scintilla editor component that is
also used by Scite, another possibility (though personally I find the
bare Scite editor just a little too tweaky to configure).

tjr
 
B

bearophileHUGS

Eduardo O. Padoan:
You are almost *describing* reinteract:

- Thank you for the link and the software, I have not tried it yet,
but from the screencast it looks quite nice.
- I am glad that there are people that don't think that Emacs is
(despite being good) the alpha and omega of editing. There's space for
other ideas beside Emacs.
- Maybe I was describing reinteract there, but that's only the first
part of my post :)
- I can see that reinteract is based on a interaction style quite
similar to the shell of Mathematica. I was talking about something
different, and more similar to TextCalc, but in the end I think
reinteract may be good enough for my purposes, so I'll try to run it.
And I may be happy enough.
- Eventually I may find the time and will to create my "interactive
python text" :) I think there's space for many different solutions.
- Despite many years of experiments, development, shells, editors, and
the like, I am sure there are other designs not yet tried or not
common enough yet (beside the normal editors, shells, smart object-
oriented graphical shells like hotwire shell, Resolver One, and few
other weird things, like one where you can zoom text and images at
different scales, other text-based systems, etc).

Bye,
bearophile
 
E

Eduardo Lenz

How about IDLE? It's a nice tool for the Python programmer. I've tried
lots of IDEs, but when it comes down to it, on small-to-medium jobs I
am be very productive indeed using IDLE...

--v

How about Eric ?


--

Eduardo Lenz Cardoso
Dr. Eng.
Associate Professor

State University of Santa Catarina
Department of Mechanical Engineering
89223-100 - Joinville-SC - Brasil

Tel: +55 47 4009-7971 - Fax: +55 47 4009-7940
E-mail: (e-mail address removed)
---------------------------------------------
 
M

Marc 'BlackJack' Rintsch

Ben Finney:


I don't know what an IBQ is.

+IBQ- seems to be the way your newsreader displays the dashes that where
in Ben's posting. I see "em dash" characters there:

In [84]: unicodedata.name(u'—')
Out[84]: 'EM DASH'

Ciao,
Marc 'BlackJack' Rintsch
 
B

bearophileHUGS

Marc 'BlackJack' Rintsch:
+IBQ- seems to be the way your newsreader displays the dashes that where
in Ben's posting.  I see "em dash" characters there:

I see, thank you. I never finish to see all the weird things of the
Web (through google groups).

Bye,
bearophile
 
E

Eduardo O. Padoan

Eduardo O. Padoan:

- Thank you for the link and the software, I have not tried it yet,
but from the screencast it looks quite nice.
- I am glad that there are people that don't think that Emacs is
(despite being good) the alpha and omega of editing. There's space for
other ideas beside Emacs.

But it is! said:
- Maybe I was describing reinteract there, but that's only the first
part of my post :)
- I can see that reinteract is based on a interaction style quite
similar to the shell of Mathematica. I was talking about something
different, and more similar to TextCalc, but in the end I think
reinteract may be good enough for my purposes, so I'll try to run it.
And I may be happy enough.

I dont known TextCalc, but I guess that reinteract is flexible enough
to the general purpose of "experimenting with Live code".
- Eventually I may find the time and will to create my "interactive
python text" :) I think there's space for many different solutions.
- Despite many years of experiments, development, shells, editors, and
the like, I am sure there are other designs not yet tried or not
common enough yet (beside the normal editors, shells, smart object-
oriented graphical shells like hotwire shell, Resolver One, and few
other weird things, like one where you can zoom text and images at
different scales, other text-based systems, etc).


Sure, thats the spirit.
 
Ð

Дамјан ГеоргиевÑки

I don't know what an IBQ is.
+IBQ- seems to be the way your newsreader displays the dashes that
where in Ben's posting. I see "em dash" characters there:

I see IBQ too ... also weird is that he has
Content-Type: text/plain; charset=utf-7

--
дамјан ( http://softver.org.mk/damjan/ )

Give me the knowledge to change the code I do not accept,
the wisdom not to accept the code I cannot change,
and the freedom to choose my preference.
 
M

Max Erickson

Years ago I have found this nice small program, TextCalc:
http://www.atomixbuttons.com/textcalc/

Despite being very limited and being not integrated with
everything else, it's so handy that for me in certain situations
it's the right tool to use when I have to process numbers and
data in simple ways. It helps me keep all the intermediate
solutions, you can save the working page just as the text file
you are seeing, it's "passive", it doesn't go bang, so if you
want you can use it just a primitive text editor. It does
something only when you ask it to. And for a basic usage there
is nearly nothing to remember.

This is mostly an aside to your question, but depending on what you
aredoing, Speq Mathematics may be an improvement over TextCalc. The
homepage is at http://www.speqmath.com/index.php?id=1.

The big differences are that it adds a good deal of functionality
(variables, a larger variety of functions, plotting, etc.) and that
it treats plain text as an error (unless the text is marked as a
comment).


max
 
M

Marc 'BlackJack' Rintsch

I see IBQ too ... also weird is that he has Content-Type: text/plain;
charset=utf-7

Why weird? Makes perfect sense:

In [98]: print '+IBQ-'.decode('utf-7')
—

In [99]: unicodedata.name('+IBQ-'.decode('utf-7'))
Out[99]: 'EM DASH'

So there are newsreaders out there that can't or at least don't decode
UTF-7.

Ciao,
Marc 'BlackJack' Rintsch
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top