top | item 437120

(no title)

marcher | 17 years ago

Up should work. If you want it to persist across sessions you'll have to enable readline history.

You might find my pythonrc useful: [link redacted] - be sure to run export PYTHONSTARTUP=~/.pythonrc.py.

My script does the following:

1. Enables readline tab completion. 2. Makes tab insert four spaces. 3. Persists command history (~/.pyhistory). You can disable it by running NOHIST= python. 4. Changes the print hook on functions to include their signature, as well as their documentation. 5. Changes the print hook to use pprint for everything else, also taking into account the terminal width. 6. Colorizes exceptions if Pygments is available. 7. Adds a source() function that shows you the source code of a function, class, or module in your pager. Code is syntax highlighted if Pygments is available. This function works on zipped eggs as well.

Also, enabling readline means all your ~/.inputrc bindings will work. So for example you can hit ^R to search back in history for a snippet you wrote.

discuss

order

breck|17 years ago

Oops. As it turns out this box is running FC. I'm going to try things on a different box. Thanks for pythonrc! (doesn't quite work on this box because readline isn't working for some reason)