title: Name 'main' not defined
body: <p>I was trying to make tetris game using reinforcement learning. I get this name undefined error.Thanks in advance for the solution</p>
  
  <pre><code>class TetrisApp
  ...........
  ..........
  other code
  ..........
  ..........
   def main(argv):
              cp = ''
              try:
                      opts, args = getopt.getopt(argv,"hc:c:",["computer_player="])
              except getopt.GetoptError:
                      print 'tetris.py -c[--computer_player] &lt;True&gt;|&lt;False&gt;'
              sys.exit(2)
              if len(opts) == 0 :
                      play(True)
                      for opt, arg in opts:
                              if opt == '-h':
                                      print 'tetris.py -c &lt;True&gt;|&lt;False&gt;'
                                      sys.exit()
                              elif opt in ("-c", "--computer_player"):
                                      cp = arg
                                      if cp == 'True':
                                              play(True)
                                      else:
                                              play(False)
  if __name__ == "__main__":
      main(sys.argv[1:])
  </code></pre>