title: Menu and submenu python
body: <p>How can I return from a sub menu to a main menu?
  Also I want to keep the data generated in the submenu.</p>
  
  <p>Main menu:</p>
  
  <pre>
  1. Load data
  2. Filter data
  3. Display statistics
  4. Generate plots
  5. Quit
  </pre>
  
  <p>On option 2 I have a submenu:</p>
  
  <pre>
  1. S. enterica
  2. B. cereus
  3. Listeria
  4. B. thermosphacta
  5. Quit
  </pre>
  
  <pre><code>def mainMenu():  
      menuItems = np.array(["Load data", "Filter data", "Display statistics", "Generate plots", "Quit"])
      while True:
          choice = displayMenu(menuItems)
          if choice == 1:
              filename = input("Please enter filename: ")
              data = dataLoad(filename)
          elif choice == 2:
              menuItems = np.array(["S. enterica", "B. cereus", "Listeria", "B. thermosphacta", "Quit"])
              while True: 
                  choice = displayMenu(menuItems)
                  if choice == 1:
                      data = data[data[:,2] == 1] # 1 - S. enterica
                  elif choice == 2:    
                      data = data[data[:,2] == 2] # 2 - B. cereus
                  elif choice == 3:   
                      data = data[data[:,2] == 3]  # 3 - Listeria
                  elif choice == 4:    
                      data = data[data[:,2] == 4] # 4 - B. thermosphacta
                  elif choice == 5:
                      return data
                  continue
          if choice == 3:
              statistic = input("Please enter statistic: ")
              print (dataStatistics(data, statistic))
          elif choice == 4:
              dataPlot(data)
          elif choice == 5:
              break
  </code></pre>