Per default speichert sich die Session in /tmp/console.sess, wenn man was anderes will einfach an load/dump übergeben. Nach der Installation kann man das in etwa so verwenden:
Code: Alles auswählen
mitsuhiko@nausicaa:~/Development/sandbox$ python
Python 2.5.1 (r251:54863, Sep 27 2007, 07:23:02)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pshell
>>> from werkzeug import url_decode
>>> x = url_decode("foo=bar&foo=baz")
>>> x["blah"] = "something else"
>>> def adder(x):
... return lambda y: x + y
...
>>> add_two = adder(2)
>>> pshell.dump()
>>>
Code: Alles auswählen
mitsuhiko@nausicaa:~/Development/sandbox$ python
Python 2.5.1 (r251:54863, Sep 27 2007, 07:23:02)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pshell
>>> pshell.load()
>>> x
MultiDict([('blah', 'something else'), ('foo', u'bar')])
>>> add_two(23)
25
>>> dir()
['__builtins__', '__doc__', '__name__', 'add_two', 'adder', 'pshell', 'url_decode', 'x']