array, a better shell

B

bearophileHUGS

For array.array "B" means unsigned char, and such arrays accept to be
initialized from (str) strings too, this is quite useful:

But it seems such capability isn't shared with the append:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: an integer is required

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

I like a lot the Python shell, it helps me in many different
situations. I have tried some Python shells:
- the vanilla one from DOS
- the one from ActivePython IDE
- the one from SPE
- ipython from a DOS shell

But none of them has what I'd like.
ipython tries to be a better shell, but I don't want more complexity
and more commands/tricks to remember, I want something more
interactive, that's simpler and more powerful to use, and not something
(much) more complex. Much less things, but the important ones.
Beside the vanilla one, I end using the SPE one (because it has colours
on Windows too, and it allows you to paste a piece of interactive shell
with the leading >>>, SPE removes them automatically. This is very
handy).

I have also used the shell of Mathematica. It's quite powerful and it
can show graphics too inlined, but globally I don't like it fully
because it makes editing small programs a pain (for me). Even if I
globally don't like the Mathematica shell, it has a capability that I'd
like to have in a basic Python shell too.
(NOTE: often when dealing with GUI subtle details make a *big*
difference, and it's not easy to use words to describe such interaction
details.)
This Mathematica shell allows you to edit small programs (like 1-15
lines of code) as input blocks, and later you can click on them and
edit them. When you press shift-enter inside a block, that small
program runs and its output goes just below it (and not at the end of
the current shell log). All the Input Blocks can be edited and run
again like that (an Input/Output number tag helps to keep things sorted
enough). So it's a cross between a normal stupid shell that's
essentially an I/O + visual log, and a bare-bone text editor that
allows you to edit one script and run it too.
Such capability probably needs a Tk/Wx/Gtk window...

-------

(Such interactive sessions can be saved too, and loaded again (they
become complex documents), but such ability isn't necessary into a
bare-bone shell that I am describing now. I am describing something as
simple as possible).

Beside that (new) basic shell capability I think I can appreciate two
other capabilities:
- Automatically saves the last 20 MBytes of textual input/output log
inside a "queue" file. Material older than the last 20 MB is removed
from the top.
- Ability to break the computation (or the printing of VERY long
things!) without exiting the shell and the kernel (this is from
Mathematica too).

Bye,
bearophile
 
S

Steven D'Aprano

For array.array "B" means unsigned char, and such arrays accept to be
initialized from (str) strings too, this is quite useful:

But it seems such capability isn't shared with the append:
[snip]

I like a lot the Python shell, it helps me in many different
situations. I have tried some Python shells:
- the vanilla one from DOS
- the one from ActivePython IDE
- the one from SPE
- ipython from a DOS shell

But none of them has what I'd like.


Is there a shortage of bytes, that Usenet posts about completely different
topics have to message-pool?

Did you have any questions, or were you just talking to yourself?

[snip]

(Such interactive sessions can be saved too, and loaded again (they
become complex documents), but such ability isn't necessary into a
bare-bone shell that I am describing now. I am describing something as
simple as possible).

No you're not. You're describing a quite complicated shell. You're
describing a hypothetical shell with features other actual shells don't
have, so therefore it can't possibly be as simple as possible. Perhaps
what you meant to say was "the bare-minimum I consider worth using"?
 
B

bearophileHUGS

Steven D'Aprano:
No you're not. You're describing a quite complicated shell. You're
describing a hypothetical shell with features other actual shells don't
have, so therefore it can't possibly be as simple as possible.

You are right, it's not really simple, but:
- It has just the basic functionality that I think is important. Many
more features can be added, I too can list some of them, but I don't
think they are much important.
- It's very simple from the user point of view, because its usage
requires no new commands to remember :) (beside shift-enter or
something similar to run a block).

Thank you for listening,
bye,
bearophile
 
D

Duncan Booth

This Mathematica shell allows you to edit small programs (like 1-15
lines of code) as input blocks, and later you can click on them and
edit them. When you press shift-enter inside a block, that small
program runs and its output goes just below it (and not at the end of
the current shell log). All the Input Blocks can be edited and run
again like that (an Input/Output number tag helps to keep things sorted
enough).

Sounds pretty close to what Idle does:

The Idle shell allows you to enter small programs as input blocks, and edit
them while entering them. Later you can click on them and bring them back
to the bottom of the input buffer for further editing (so no confusing
output appearing out of order), and you can always look back at all earlier
versions of the block. All the Input Blocks can be edited and run again
like that.

Your point was?
 
B

bearophileHUGS

Duncan Booth:
Later you can click on them and bring them back
to the bottom of the input buffer for further editing (so no confusing
output appearing out of order),

I think that's worse, not better. You end with a messy final "document"
(log), so finding things into it (during the editing too) is much more
difficult.

Your point was?

My point is to suggest things that can improve the Python user
experience, and productivity too. I try to help, with the hope to have
something that I like more too.

It's very difficult to describe subtle GUI functionalities using a
texual description (expecially when you aren't using your native
language). If you try the Mathematica shell you may find some
differences I am talking about (even if I don't globally like the
Mathematica shell).
Editing an input block into idle feels different from editing a small
script inside an editor, there are differences that make the user
experience less good.
(And beside that it seems I often have problems running IDLE on Win PCs
with a firewall).

Bye,
bearophile
 
N

Neil Cerutti

For array.array "B" means unsigned char, and such arrays accept to be
initialized from (str) strings too, this is quite useful:


But it seems such capability isn't shared with the append:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: an integer is required
Try:
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top