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:
def read_board(board_file):
""" (file path) -> list of str
Return a board read from open file board_file.
>>>read_board('C:\Python33\Doc\theboard1.txt')
"""
bo_file = open(board_file, 'r')
lines = bo_file.readlines()
return lines
I'm getting this error
OSError: [Errno 22] Invalid argument: 'C:\Python33\Doc\theboard1.txt'
The path is correct (triple checked) and I'm using that example to test the file read.