
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
Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.

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

Sturla Molden wrote:
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 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 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.

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
Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.

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

Sturla Molden wrote:
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 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 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