From pythondevdang at lazytwinacres.net Thu Aug 9 23:19:31 2007 From: pythondevdang at lazytwinacres.net (Daniel 'Dang' Griffith) Date: Thu, 09 Aug 2007 17:19:31 -0400 Subject: [CentralOH] Tip for string interpolation In-Reply-To: References: Message-ID: <6.2.3.4.2.20070809171010.0281ebd8@mail.lazytwinacres.net> As an aside (if you can have an aside at the beginning), I've never really liked the name "string interpolation". I usually just call it "the string formatting operator". But anyway... I came across a bunch of good Python tips at "http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html", and got excited about one in particular, and wanted to share my interpretation of the string interpolation tip. It was new to me, and I am not taking credit for it. I'm just sharing it, in case we run around in different circles, as we reinvent different wheels. No doubt, you've done this kind of thing, to print or evaluate a string containing some formatted values: a = 'Three' b = 5 print "A=%s, B=%d" % (a, b) And, you might also have used a dictionary to hold some values, and then used that dictionary in a similar manner. Note that when using a dictionary, you put the key name between parentheses, between the % sign and the type (s, d, l, etc): mydict = {'a': 'Three', 'b': 5} print "A=%(a)s, B=%(b)d" % mydict But here's one I learned from this tip. If the variables are in the same namespace, you can just refer to that dictionary: a = 'Three' b = 5 print "A=%(a)s, B=%(b)d" % locals() (or if the code is within a class, print "A=%(a)s, B=%(b)d" % self.__dict__) In other words, if you want to print the values of some variables, don't bother enumerating them as in style 1, or maintaining a separate dictionary, as in style 2. I hope someone else gets excited about this little tidbit as I did. In hidhsight, it's obvious, but I definitely didn't realize it, and I've been Pythoning for a few years. --dang ---------------------------------------- A noble spirit embiggens the smallest man. --Jebediah Springfield ---------------------------------------- From yungyuc at gmail.com Sat Aug 25 01:08:26 2007 From: yungyuc at gmail.com (Yung-Yu Chen) Date: Fri, 24 Aug 2007 19:08:26 -0400 Subject: [CentralOH] Hello all Python folks in Ohio Message-ID: <423e92430708241608t516b5f03vc17199040178b30a@mail.gmail.com> Hello, Greet. It's so nice to learn here is a Python community! I just came from Taiwan (FYI: http://en.wikipedia.org/wiki/Taiwan ) and arrived Columbus 10 days ago. I have used Python for 3 years, and found it is so fun to program. I've programmed several scripts to do numerical analysis in Python and then tried to apply it to every cases I encountered, of course including web programming (I used Django.) Now I am most interested in numpy, especially the f2py part. Do we have something like an IRC channel? I just looked around the list and googled a little but found none. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/mailman/private/centraloh/attachments/20070824/f014f5a3/attachment.htm From kartic.krish at gmail.com Sat Aug 25 01:21:18 2007 From: kartic.krish at gmail.com (Kartic Krishnamurthy) Date: Fri, 24 Aug 2007 16:21:18 -0700 Subject: [CentralOH] Hello all Python folks in Ohio In-Reply-To: <423e92430708241608t516b5f03vc17199040178b30a@mail.gmail.com> References: <423e92430708241608t516b5f03vc17199040178b30a@mail.gmail.com> Message-ID: <52ffb22c0708241621q57951fcdg6c573811f0b8b00a@mail.gmail.com> Hi Yung, Welcome to Columbus (though I am not in Columbus at present). There is a Python IRC channel on irc.freenode.net channel - #python. Other than the main Python channel, CoPY itself does not have an IRC channel, AFAIK. Thanks, +Kartic On 8/24/07, Yung-Yu Chen wrote: > Hello, > > Greet. It's so nice to learn here is a Python community! I just came from > Taiwan (FYI: http://en.wikipedia.org/wiki/Taiwan ) and > arrived Columbus 10 days ago. I have used Python for 3 years, and found it > is so fun to program. I've programmed several scripts to do numerical > analysis in Python and then tried to apply it to every cases I encountered, > of course including web programming (I used Django.) Now I am most > interested in numpy, especially the f2py part. > > Do we have something like an IRC channel? I just looked around the list and > googled a little but found none. From kmcneillie at softwarespecialists.com Thu Aug 30 18:04:58 2007 From: kmcneillie at softwarespecialists.com (Kelley McNeillie) Date: Thu, 30 Aug 2007 12:04:58 -0400 Subject: [CentralOH] Please assist: Python Developer needed for 3-6 month contract in Pittsburgh, PA Message-ID: I am contacting you from a company called Software Specialists, an IT Placement Firm based in Pittsburgh, PA. We are prepared to make a donation to your organization if you could please help us out with a referral. We are looking for a python developer with web-based application experience. If you know of anyone, or if you would be able to post this opportunity on your site, I would greatly appreciate it. I am finding this skill pretty much impossible to identify locally, and I really would like to be able to assist my client with this position. I am just trying to be creative in my search, I hope I am reaching the right person with this request. If not, I apologize. Thank you in advance for any assistance you may be able to provide. Best Regards, Kelley McNeillie Software Specialists, Inc. 357 Northgate Drive Suite 10 Warrendale, PA 15086 724 933 6100 x 1105 724 933 6106 (F) kmcneillie at softwarespecialists.com www.softwarespecialists.com