title: How to set pdb break condition from within source code?
body: <p><strong>Problem:</strong> If I have an elaborate breakpoint condition, I don't want to have to <code>pdb.set_trace()</code> then paste the breakpoint command manually every time I restart my program.</p>
  
  <p>Is there a way to set a breakpoint from within my source-code?</p>
  
  <p><strong>What I tried:</strong> I read the docs and tried to insert this line:</p>
  
  <pre><code>pdb.run('break 445, a == 1')
  </code></pre>
  
  <p>But I got this error once execution hit that line:</p>
  
  <pre><code>    pdb.run('break 445, a == 1')
    File "C:\Python25\lib\pdb.py", line 1123, in run
      Pdb().run(statement, globals, locals)
    File "C:\Python25\lib\bdb.py", line 366, in run
      exec cmd in globals, locals
    File "&lt;string&gt;", line 1
      break 445, a == 1
              ^
  SyntaxError: invalid syntax
  </code></pre>