title: iPython notebook avoid printing within a function
body: <p>I want to prevent a function to print in iPython notebook. </p>
  
  <p>In standard python one can prevent printing some lines of code as answered in the question: <a href="https://stackoverflow.com/questions/8447185/to-prevent-a-function-from-printing-in-the-batch-console-in-python">To prevent a function from printing in the batch console in Python</a>
  However this method do not work in iPython notebook, losing the output until a restart of the Kernel.</p>
  
  <p>The most similar feature I found is to avoid a full cell to display using the magic function: </p>
  
  <pre><code>%%capture capt
  </code></pre>
  
  <p>However this magic function blocks the whole cell, is there any way in iPython notebook to avoid printing just some of the lines within the code?</p>