From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25242 invoked by alias); 18 Nov 2003 13:30:14 -0000 Mailing-List: contact xconq7-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: xconq7-owner@sources.redhat.com Received: (qmail 25228 invoked from network); 18 Nov 2003 13:30:13 -0000 Received: from unknown (HELO rwcrmhc13.comcast.net) (204.127.198.39) by sources.redhat.com with SMTP; 18 Nov 2003 13:30:13 -0000 Received: from flacy.home.flacy (c-24-0-117-162.client.comcast.net[24.0.117.162]) by comcast.net (rwcrmhc13) with ESMTP id <2003111813301201500nj9vde>; Tue, 18 Nov 2003 13:30:12 +0000 Received: from flacy.home.flacy (IDENT:1000@localhost [127.0.0.1]) by flacy.home.flacy (8.12.9/8.12.8) with ESMTP id hAIDUBsP021956 for ; Tue, 18 Nov 2003 07:30:12 -0600 From: "Mark A. Flacy" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16314.7906.67114.244055@flacy.home.flacy> Date: Tue, 18 Nov 2003 13:37:00 -0000 To: "'xconq'" Subject: OT Python stuff (was RE: Python in Xconq) In-Reply-To: <001501c3adc1$11b31bf0$6401a8c0@Win2k> References: <001501c3adc1$11b31bf0$6401a8c0@Win2k> X-Priority: 3 X-SW-Source: 2003/txt/msg00763.txt.bz2 >>>>> "Erik" == Erik Jessen writes: Erik> Erik> Perl has all that as well - I know, because I use them on a regular Erik> basis. Also, there are a great many modules others have written, to Erik> enable things like network play (RPC/IPC/IRC/etc.). Erik> Erik> But again, I've not seen Python, so it may do all those things in a Erik> much nicer way. My running joke is that Python has a very simple syntax while Perl has a shitload of syntaxes. If you know C, C++, or Java, you won't find very many syntax surprises in Python. You can write a lot of code without using any of the Python "odd" constructions. Even so, you can write such gems as... dirList = [ [k , v] for (k, v) in tmap.iteritems()] ...which converts a hashmap of tuples into a list of lists or ... webClientDirs = [os.path.join("com", "mycompany", "argle", "cap", "web", "ua", "base", "session"), os.path.join("com", "mycompany", "argle", "cap", "web", "ua", "pca", "appl"), os.path.join("com", "mycompany", "argle", "foundation", "awt", "layout"), os.path.join("com", "mycompany", "argle", "base", "ccpe", "base"), os.path.join("com", "mycompany", "argle", "base", "ccpe", "events"), os.path.join("com", "mycompany", "argle", "base", "ccpe", "model"), os.path.join("com", "mycompany", "argle", "base", "ccpe", "type"), os.path.join("com", "mycompany", "argle", "mw", "gui"), os.path.join("com", "mycompany", "argle", "mw", "sdp", "jni"), os.path.join("com", "mycompany", "bargle", "base") ] fulldirs = map(lambda x: os.path.join(self.config.compileDest, x), webClientDirs) ...which created a list of subdirectories (in a cross-platform fashion) and then prepends a root directory to each element of the list producing another list for later processing. http://www.linuxjournal.com/article.php?sid=3882 is written by the guy that wrote fetchmail. Worth a read. -- Mark A. Flacy Any opinions expressed above are my own. Any facts expressed above would imply that I know what I'm writing about. Sometimes, I do! "Just because you're paranoid doesn't mean they aren't out to get you anyways."