"Breaking" the __main__ script

Jean-Michel Pichavant jeanmichel at sequans.com
Mon Mar 15 19:50:18 CET 2010


Jean-Michel Pichavant wrote:
> vsoler wrote:
>> Hello,
>>
>> I am still learning python, thus developnig small scripts.
>>
>> Some of them consist only of the main module. While testing them
>> (debugging) I sometimes want to stop the script at a certain point,
>> with something like    stop, break, end   or something similar.
>>
>> What statement can I use?
>>
>> Vicente Soler
>>   
> import bdb
>
> pdb.set_trace() # put this line anywhere you want a breakpoint in your 
> code.
>
> type n for next, c for continue, s for step into and google for 
> 'python pdb' for the details.
>
> JM
erratum

import pdb



More information about the Python-list mailing list