[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: CGI Help



Another cheer for Python! I ported a C++ daemon that wouldn't compile
cleanly on Pair Networks' FreeBSD systems (old version of GCC and the
STL) to Python in two days (my first Python program!) and:
* code was 200 lines of code vs 500 of C++ and all in one file instead
  of 5 files of C++
* code ran _much_ faster, partially due to this feature:
my_list = ["Alpha", "Beta", "Gamma"]
if "Epsilon" in my_list: <-- 'in' is a godsend
	print "Uh-oh, something's really wrong here"
  (I was too lazy to use a binary search routine in C++, so I hit the
  database server several hundred times)
* things like data = urllib.urlopen("http://www.debian.org";) replaced 20
  lines of C++ code that used the GNOME-specific libghttp1 (another
  thing to compile/install on their system)
* the regexp .{5}\s+(\d{3,4})p?\s+(?:\d{3,4}p?)?\s*\w{2}\s+(?:(?:( 
\d{2})-(\d{2}))|Life)\s+<A.*USCF/(\d{8}).*/A>(?:\s+.{5}\s+(\d{3,4})
\s*(?:\d{3,4}p?)?)?
saved me almost a hundred lines of text parsing.

Did I mention I like Python a lot?

My next project..developing an admin system using Python and wxWindows.
I can develop under Linux and deliver it to my client running
Windows without changing the code..do that with any other language
(including the much-acclaimed JDK/Swing combo!)
-- 
Stephen Pitts
smpitts@midsouth.rr.com
webmaster - http://www.mschess.org


Reply to: