david.iungerich at kwe.com
Thu Aug 22 11:00:02 EDT 2002
There was some whitespace junk in the file. The following works fine.
postReply = urllib.urlopen("http://css.kwe.com/web.forte",
f = open("D:\PythonServerMonitor\KWE1144589.dat","r")
controlData = f.read()
print " <ControlData>" + str(len(controlData)) + "</ControlData>"
print " <ServerData>" + str(len(postReply)) + "</ServerData>"
if (postReply == controlData):
response = "<ServerResponseTest>Response - OK</ServerResponseTest>"
response = "<Result>Server Not Responding</Result>"
# e-mail appropriate party.
# e-mail the admin.
From: python-list-admin at python.org
[mailto:python-list-admin at python.org]On Behalf Of Brian Jones
Sent: Thursday, August 22, 2002 3:57 AM
To: python-list at python.org
Subject: Re: String comparison
> if s1.lower() == s2.lower():
> I suppose this would do the trick, too:
> if re.match( '^' + s1 + '$', s2, re.I ):
> I'm not sure which of these is better (or maybe it is neither!), though,
> of course, I'd like to know what the One True Path is...
As a real Python newbie making his first post here may I vote for the
For me one of Python's great strengths is that it does not carry the
baggage of C++ or Java, and avoids the obfuscation of Perl (and readily
available in C). It is clean and intrinsically simple.
The first of your choices bears the simplicity of Python whilst the
second reminds me of Perl.
Regexs are powerful when they are needed but why add complexity and
decrease readability where they are not needed.
More information about the Python-list