title: Python compatability issue - 'in <string>' requires character as left operand
body: <p>I make no claims to know anything at all about writing Python scripts or programming in general, but I've been tasked with writing one anyway that will have to operate on a wide variety of Python versions.  I wrote, and did my testing on versions 2.3, 2.4 and all went well.  Version 2.2 though is giving me fits and my google-fu must be weak because I'm coming up short with an answer.</p>
  
  <p>The section of code that's giving me problems:</p>
  
  <pre><code>
  commandnum = 0
  for commandloop in arguments[0:]:
      if "java" in arguments[commandnum][0]:
          for argloop in arguments[commandnum]:
              if "Dcatalina.home" in argloop:
                  instance = argloop.split("/")
              elif "-Xms" in argloop:
                  xms = argloop.split("Xms")
              elif "-Xmx" in argloop:
                  xmx = argloop.split("Xmx")
              elif "-XX:MaxPermSize" in argloop:
                  permsize = argloop.split("=")
              elif "Dcatalina.base" in argloop:
                  home = argloop.split("=")
                  appdir = home[-1]+"/webapps"
                  warfiles = []
                  for war in os.listdir(appdir):
                      if fnmatch.fnmatch(war, '*.war'):
                          warfiles.append(war)
                  thefiles = ",".join(warfiles)
          try:
              instance
          except NameError:
              instance = None
          if instance is not None:
              print "%s %s %s %s %s %s" % (instance[-2], xms[-1], xmx[-1], permsize[-1], appdir, thefiles)
      commandnum = commandnum + 1
  </code></pre>
  
  <p>I understand that this is <em>UGLY</em> and probably a <em>BAD</em> thing, but the error that I'm getting is in the string matching using 'in'.  From what I gather by googling, in Python 2.2 you're limited to one character for string matching using 'in'.  What is the equivalent way in 2.2 to match on a string?</p>
  
  <p>Upgrading machines to a modern version of Python is out of the question.</p>
  
  <p>Any help/abuse is appreciated.  Try to be gentle as this is the first thing of any size I've written outside of shell scripts and MS Basic on my TRS-80 CoCo in 1981.</p>