title: opening a file in a function python 3
body: <p>I'm a beginner trying to open a file as part of a function where the file name/path is the variable in the function. I've written one but am getting an error on a similar function. Here's the function code:</p>
  
  <pre><code>def read_board(board_file):
      """ (file path) -&gt; list of str
  
      Return a board read from open file board_file. 
  
      &gt;&gt;&gt;read_board('C:\Python33\Doc\theboard1.txt') 
      """
  
      bo_file = open(board_file, 'r')
      lines = bo_file.readlines()
  
      return lines
  </code></pre>
  
  <p>I'm getting this error </p>
  
  <blockquote>
    <p>OSError: [Errno 22] Invalid argument: 'C:\Python33\Doc\theboard1.txt'</p>
  </blockquote>
  
  <p>The path is correct (triple checked) and I'm using that example to test the file read.</p>