#### Python Recursive Maze

So we have to make a recursive maze:
the input file is:

WPPWWW
WWPWPS
WWPWPW
PPPPPW
FWPWWW
WPPPPW

The code below is what i have so far. It is supposed to print out a list of coordinate points for the path it has to follow. if no solution, prints "no solution". Thanks in advance for the help. I'm not sure where i'm going wrong although i know there are mistakes.
#################################

#this function reads a maze file, filename, and creates a maze, m.
# Please declare "m" as a list before calling the function and then pass it in.
m=[] # This declares the maze as an empty list
mazeFile = open(filename, "r")
for line in lines:
line = line.strip()
row = [c for c in line]
m.append(row)

print m # This prints the maze, showing it with the usual notation as a "list of lists"
start = []

def findStart(m):
start = []
mazeSolution = []
for row in xrange(len(m)):
for col in xrange(len(m[row])):
if m[row][col]== "S":
start = [row,col]
mazeSolution = start
return mazeSolution

def solveMaze(m, mazeSolution):
mazeSolution = findStart(m)
row = mazeSolution[0]
col = mazeSolution[1]
return( solveMaze2(m, mazeSolution, row, col))

###############
import copy
def countMaze(m, row, col):

memoMap = copy.deepcopy(m)
return solveMaze2(m,memoMap,row,col)

def solveMaze2(m,memoMap,row,col):
memoMap = copy.deepcopy(m)
if ( (row<0) or (col<0) ):
return 0
if ( (row >= len(m[0])) or (col >= len(m[1]))):
return 0

if (memoMap[row][col] == "F"):
return 0

if (m[row][col] != "P"):
return 0

memoMap[row][col] = "W"

if(solveMaze2(m,memoMap,row-1,col)):
mazeSolution.append(row-1,col)
return True
elif(solveMaze2(m,memoMap,row,col-1)):
mazeSolution.append(row,col-1)
return True
elif(solveMaze2(m,memoMap,row,col+1)):
mazeSolution.append(row,col+1)
return True
elif(solveMaze2(m,memoMap,row+1,col)):
mazeSolution.append(row+1,col)
return True

else:
return False

##################
def mazeSolver2():
mazeFile = "sampleMaze.txt"