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
> 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.
Adding an editor to Python solves this problem only for Python. I
certainly wouldn't want to learn a new text editor just for one
language. You're not *only* programming in Python, I hope?
Many of us solve this by using a single full-featured programmer's
editor that allows invoking a program — written in any of *dozens or
hundreds* of different languages — from within the editor.
It's a solution that only requires you to learn one editor interface,
having chosen one that's well-supported on all popular platforms and
with plug-ins accumulated over many years for a smorgasbord of
different tasks. The leaders in the field, by far, are GNU Emacs
<URL:http://www.gnu.org/software/emacs/emacs.html> and Vim
<URL:http://vim.org/>.
--
\ “Jury: A group of 12 people, who, having lied to the judge |
`\ about their health, hearing, and business engagements, have |
_o__) failed to fool him.” —Henry L. Mencken |
Ben Finney
> 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.
Adding an editor to Python solves this problem only for Python. I
certainly wouldn't want to learn a new text editor just for one
language. You're not *only* programming in Python, I hope?
Many of us solve this by using a single full-featured programmer's
editor that allows invoking a program — written in any of *dozens or
hundreds* of different languages — from within the editor.
It's a solution that only requires you to learn one editor interface,
having chosen one that's well-supported on all popular platforms and
with plug-ins accumulated over many years for a smorgasbord of
different tasks. The leaders in the field, by far, are GNU Emacs
<URL:http://www.gnu.org/software/emacs/emacs.html> and Vim
<URL:http://www.vim.org/>.
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.
> 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
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.
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
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.
--
Eduardo de Oliveira Padoan
http://djangopeople.net/edcrypt/
"Distrust those in whom the desire to punish is strong." -- Goethe,
Nietzsche, Dostoevsky
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.
>> 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).
tjr
- 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
> Ben Finney:
>
>> 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.
+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
I see, thank you. I never finish to see all the weird things of the
Web (through google groups).
Bye,
bearophile
But it is! <wink>
> - 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.
> Bye,
> bearophile
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
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: le...@Joinville.udesc.br
---------------------------------------------
--
Esta mensagem foi verificada pelo sistema de antivírus e
acredita-se estar livre de perigo.
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.
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
>>> 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
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
http://code.google.com/p/pyscripter/
jab