title: Printing a Data Structure
body: <p>I'm programming a Sudoku solver, and as part of that I'm creating a class to represent a Sudoku board. Part of the functionality of the class is the ability to print itself. Right now I have a method PrintBoard as part of my class. So I would use it like this:</p>
  
  <pre><code>myBoard.PrintBoard()
  </code></pre>
  
  <p>But I was thinking; is there a way to override python's print so that:</p>
  
  <pre><code>print(myBoard)
  </code></pre>
  
  <p>runs the PrintBoard method?</p>