title: How to read a text file line by line like a set of commands
body: <p>I have a text file that has written a function name along with the parameters such as "insert 3" where I need to read the insert and 3 individually to call a function insert with parameter 3.</p>
  
  <p>I have so far opened the file and called .readlines() on it to separate each line into a list of each line of text. I am now struggling to find a way to apply .split() to each element recursively. I am to do this with functional programming and I cannot use a for loop to apply the .split() function.</p>
  
  <pre><code>def execute(fileName):
      file = open(fileName + '.txt', 'r').readlines()
      print(file)
      reduce(lambda x, a: map(x, a), )
  </code></pre>
  
  <p>I would like to use each line independently with different amounts of parameters so I can call my test script and have it run each function.</p>