
When working with Python interactive shell (particularly IDLE started from Windows start menu), one thing I miss is a cd statement. Ok, I can do
import os os.setcwd('e:\\work')
But I keep feeling that Matlab's cd statement is more handy:
cd e:\work
One other feature that makes Matlab's shell more handy, is the whos statement. It lists all variables created form the shell, types, etc. Yes it is possible to get all local and global names in Python/IDLE, but that is not the same. The variables created interactively get hidden in the clutter. IDLE also lacks a command history. If I e.g. make a typo, why do I have to copy and paste, instead of just hitting the arrow button? Although cosmetically, these three small things keep annoying me. :-( Sturla Molden

On Tue, Mar 10, 2009 at 03:51:24PM +0100, Sturla Molden wrote:
cd e:\work
See DirChanger at http://phd.pp.ru/Software/dotfiles/init.py.html . With it you can do
cd('work') cd /home/phd/work
Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.

Why not to use IPython? On Tue, Mar 10, 2009 at 5:58 PM, Oleg Broytmann <phd@phd.pp.ru> wrote:
On Tue, Mar 10, 2009 at 03:51:24PM +0100, Sturla Molden wrote:
cd e:\work
See DirChanger at http://phd.pp.ru/Software/dotfiles/init.py.html . With it you can do
cd('work') cd /home/phd/work
Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN. _______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas
-- С уважением, Андрей Попп. +7 911 740 24 91

On Tue, Mar 10, 2009 at 10:51 AM, Sturla Molden <sturla@molden.no> wrote:
IDLE also lacks a command history. If I e.g. make a typo, why do I have to copy and paste, instead of just hitting the arrow button?
Command history in IDLE is bound to alt-n (next) and alt-p (previous) by default. -- Jerry

2009/3/10 Sturla Molden <sturla@molden.no>:
When working with Python interactive shell (particularly IDLE started from Windows start menu), one thing I miss is a cd statement. Ok, I can do
import os os.setcwd('e:\\work')
But I keep feeling that Matlab's cd statement is more handy:
cd e:\work
One other feature that makes Matlab's shell more handy, is the whos statement. It lists all variables created form the shell, types, etc. Yes it is possible to get all local and global names in Python/IDLE, but that is not the same. The variables created interactively get hidden in the clutter.
IDLE also lacks a command history. If I e.g. make a typo, why do I have to copy and paste, instead of just hitting the arrow button?
Although cosmetically, these three small things keep annoying me. :-(
Have you tried IPython? -- Arnaud

Sturla Molden wrote:
Arnaud Delobelle wrote:
Have you tried IPython?
Yes, it has all that I miss, but it's ugly (at least on Windows, where it runs in a DOS shell).
S.M.
Hear, hear! GUI interactive prompts FTW! In IDLE you can also just move the cursor to a previous line of code (or code block), hit Return and you'll have that code on your current command line, ready to be edited and executed. As for changing directories, I find "from os import chdir as cd, getcwd as cwd" satisfactory. I have it in the python file referenced by the PYTHONSTARTUP environment variable, and I've changed all the relevant shortcuts (on Windows) to run IDLE with the -s flag (which causes the PYTHONSTARTUP file to be imported before anything else). - Tal

Hey Sturla,
Have you tried IPython?
Yes, it has all that I miss, but it's ugly (at least on Windows, where it runs in a DOS shell).
Have you tried running it with http://sourceforge.net/projects/console/ ? I found that to be a lot prettier than the standard DOS prompt. And IPython really is great -- it increases your productivity in Python dramatically. Especially with its ? and ?? commands. I would heartily recommend it. -- love, tav plex:espians/tav | tav@espians.com | +44 (0) 7809 569 369 http://tav.espians.com | http://twitter.com/tav | skype:tavespian

Sturla Molden <sturla@...> writes:
Arnaud Delobelle wrote:
Have you tried IPython? Yes, it has all that I miss, but it's ugly (at least on Windows, where it runs in a DOS shell).
It is getting there. The 0.9 release had wx interface with minimal functionality. I have crossed my fingers for 0.10 release. Regards, Suraj

Sturla Molden wrote:
IDLE also lacks a command history. If I e.g. make a typo, why do I have to copy and paste, instead of just hitting the arrow button?
There is already a patch on the tracker to make IDLE's history work the same (with arrow keys) as the command window. It is one of about 70 open issues which are languishing due to the lack of a maintainer/committer. Someone perhaps volunteered a few days ago.
participants (9)
-
Andrey Popp
-
Arnaud Delobelle
-
Jerry Hill
-
Oleg Broytmann
-
Sturla Molden
-
Suraj Barkale
-
Tal Einat
-
tav
-
Terry Reedy