sys.excepthook and syntax errors

Fernando Pérez fperez528 at yahoo.com
Fri Dec 21 12:45:26 EST 2001


Ben Wolfson wrote:

> Occasionally when I'm in the python prompt and want to change working
> directories, I forget where I am and type "cd whatever" instead of
> "os.chdir(whatever)".  Obviously this doesn't work.  So I tried overriding
> sys.excepthook so that when I did try the former, it would have the same
> effect as the latter, but would otherwise report the error correctly.  To
> my surprise, it still wouldn't work most of the time.  That is, I could do
> this:
> 
[snip]

Try IPython (just announced an update) at  
http://www-hep.colorado.edu/~fperez/ipython

It does what you want (and lots more).

cheers,

f



More information about the Python-list mailing list