Say I do something like this in a python shell for my Django app:
>>>from myapp.models import User
>>>user = User.objects.get(pk=5)
>>>groups = user.groups.all()
What I'd like to do is stash these 3 commands somehow without leaving the shell. The goal being I can quickly restore a similar environment if I restart the shell session later.