title: Create a text menu in Python3x that is always available
body: <p>I am new to python and learning quickly. Thank you all for the help.</p>
  
  <p>I am attempting to create a text menu that will always run in the background of a storytelling text rpg. I have searched and cannot find an explanation of how to create an "always on" menu or how one would work.</p>
  
  <p>I would like the player to be able to hit "m" at any time in the game and have the menu prompt show up.</p>
  
  <p>So far, I have created a "userinput" function as well as a "menu" function that will be deployed each time the game prompts the user/player for input.</p>
  
  <pre><code>def menu():
      print('Press "1" for map &gt;&gt;&gt; "2" for stats &gt;&gt;&gt; "3" for exit')
      choice = input()
      if choice == '1':
          print('map needs to be made and shown')
      elif choice == '2':
          print('stats need to be made and assinged to choice 2 in def menu')
      elif choice == '3':
          print('You are exiting the menu. Press "M" at any time to return to the menu')
          return
      else:
          print('I did not recognize your command')
          menu()
  
  def userinput():
      print('Press 1 to attack an enemy &gt;&gt;&gt; 2 to search a room &gt;&gt;&gt; 3 to exit game')
      print('Press "M" for menu at any time')
      inputvalue = input()
      if inputvalue == 'm':
          menu()
      elif inputvalue == '1':
          print('attack function here')
      elif inputvalue == '2':
          print('search function here')
      elif inputvalue == '3':
          exit
      else:
          userinput()
  </code></pre>
  
  <p>This does not appear to be an ideal solution because the user cannot choose to view a map or exit the game at any time they want.</p>
  
  <p>Is there a way to have a menu always running in the background?</p>
  
  <p>I thought of using a while loop that would never close and all of the game would be held within that while loop but that doesn't seem economical by any means.</p>
  
  <p>Any thoughts or help would be appreciated.</p>