Ok thanks guys. but when i use filename = input('file name: ') if not filename: #i get filename is not defined return(drawBoard) #possible to return function when no file input from user?