#! /usr/bin/env python # Script for starting the crawler under the Winpdb debugger import pexpect import sys inputparam = ' '.join(sys.argv[1:]) def debugCrawler(crawler,inputparam): child = pexpect.spawn('rpdb2 -d %s %s' % (crawler, inputparam)) child.expect('password:') child.sendline('1234') startDebuggee(child.pid) child.interact() def startDebuggee(pid): # Start the and detach the debuggee rpdb = pexpect.spawn('rpdb2 -a -s %d' % pid) #child.interact() rpdb.expect('password:') rpdb.sendline('1234') rpdb.expect('commands.\r\n> ') rpdb.sendline('go') rpdb.expect('\r\n> ') rpdb.sendline('detach') rpdb.expect('\r\n> ') rpdb.sendline('exit') rpdb.expect('\r\n') if __name__ == '__main__': debugCrawler("crawlerwrapper",inputparam)