title: Can I call the function 'main' more than once in a program?
body: <p>I am writing a program that has user enter selections in a command line GUI and do not want the program to end until the user selects 'Exit'.</p>
  
  <p>So far, my only solution is to end the workhorse function with a call to 'main()' so as to not exit out.</p>
  
  <pre><code>def parse(file):
      out_file = functions(file)
      main()
  
  def get_selection():
      return selection
  
  def main():
      file_to_parse = get_selection()
      parse(file_to_parse)
      return
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>My code runs and no other considerations are needed at this time in regards to time or security. I am just wondering how gross of a programming error/mistake/bad opinion I am making.</p>