[IPython-user] Changing context in iPython CLI

Chris Youb nfn_nln at hotmail.com
Thu Oct 6 13:24:17 CDT 2005

I use the iPython shell as a command-line interface for one of my programs.
Unfortunately, I repeatedly have to prefix my commands with the variable name
I've setup.  Is there any way to change/imply context in iPython.  Here is an
example of what I mean using an instance of a String for simplicity:

This is what I do now:

In [2]: x.lower()
Out[2]: 'this is a string!'

In [3]: x.swapcase()
Out[3]: 'tHIS IS A sTRING!'

When I'd really just like to type this:

In [2]: lower()
Out[2]: 'this is a string!'

In [3]: swapcase()
Out[3]: 'tHIS IS A sTRING!'

More information about the IPython-user mailing list