Pages

Saturday, 3 March 2012

Lettuce and IPython interactive shell

Just doing the stuff with mechanize. At some point, it would be great to get an IPython console. so Why not?
@step(u'And give me IPython')                    
def and_continue_here(step):                   
    import IPython                             
    import sys                                 
    shell = IPython.InteractiveShell()         
    ip = IPython.core.ipapi.get()              
    p = IPython.core.debugger.Pdb(ip.colors)   
    p.reset()                                  
    p.interaction(sys._getframe(0), None)      

No comments:

Post a Comment