You m,igth try my page of Python Book reviews at http://www.awaretek.com/book.html
Ron Stephens fdsl ysnh wrote: > --- [EMAIL PROTECTED]: > > > Send Python-list mailing list submissions to > > python-list@python.org > > > > To subscribe or unsubscribe via the World Wide Web, > > visit > > http://mail.python.org/mailman/listinfo/python-list > > or, via email, send a message with subject or body > > 'help' to > > [EMAIL PROTECTED] > > > > You can reach the person managing the list at > > [EMAIL PROTECTED] > > > > When replying, please edit your Subject line so it > > is more specific > > than "Re: Contents of Python-list digest..." > > > Today's Topics: > > > > 1. Re: appending key-value pairs to a dict (Peter > > Hansen) > > 2. Re: Is Python suitable for a huge, enterprise > > size app? > > (Paul Rubin) > > 3. Re: appending key-value pairs to a dict (Brian > > Beck) > > 4. Re: Comparing 2 similar strings? (Skip > > Montanaro) > > 5. Re: Is Python suitable for a huge, enterprise > > size app? > > (Paul Rubin) > > 6. Re: buffer_info error ([EMAIL PROTECTED]) > > 7. Re: appending key-value pairs to a dict (James > > Stroud) > > 8. From the call hook, how do I know more > > precisely what is > > called? (Vijay Kumar) > > 9. Re: PyGame and Rotozoom (Sorry if OT) (Lee > > Harr) > > 10. Re: buffer_info error (Jp Calderone) > > 11. Re: appending key-value pairs to a dict (Roy > > Smith) > > 12. Re: Is Python suitable for a huge, enterprise > > size app? > > (Dave Brueck) > > 13. Re: Process monitoring (John Abel) > > > 发件人: Peter Hansen <[EMAIL PROTECTED]> > > 收件人: python-list@python.org > > 日期: Fri, 20 May 2005 16:12:17 -0400 > > 主题: Re: appending key-value pairs to a dict > > > > rbt wrote: > > > I know how to setup an empty list and loop thru > > something... appending > > > to the list on each loop... how does this work > > with dicts? > > > > > > I'm looping thru a list of files and I want to put > > the file's name and > > > its sha hash into a dict on each loop. > > > > Whereas with a list you would call "append" in the > > loop, with a > > dictionary you simply use an indexed-assignment type > > of access: > > > > mydict = {} > > for filename in some_list_of_filenames: > > hash = > > sha.sha(open(filename).read()).hexdigest() # or > > whatever > > mydict[filename] = hash > > > > -Peter > > > > > 发件人: Paul Rubin <http://[EMAIL PROTECTED]> > > 收件人: python-list@python.org > > 日期: 20 May 2005 13:12:50 -0700 > > 主题: Re: Is Python suitable for a huge, enterprise > > size app? > > > > Dave Brueck <[EMAIL PROTECTED]> writes: > > > One thing from your experience that did resonate > > with me is that, > > > except for ftplib and occasionally urllib (for > > basic, one-shot GETs), > > > we don't use any of the standard library's > > "protocol" modules - partly > > > because we had to implement our own HTTP libraries > > for performance and > > > scalability reasons anyway, and partly because we > > had trouble figuring > > > out e.g. all the ins and outs of > > urllib/urllib2/httplib. > > > > What do you use for HTTPS? And did you use the > > Cookie module in your > > HTTP servers? You may have had problems without > > even being aware of > > them (until recently if you used Cookie with its > > default settings, any > > attacker could completely take over your server by > > sending you > > carefully concoted cookies). I'm not trying to be > > contentious here, > > just mentioning a couple further cases of where > > problems aren't > > visible from far away but are there when you look > > close. > > > > > 发件人: Brian Beck <[EMAIL PROTECTED]> > > 收件人: python-list@python.org > > 日期: Fri, 20 May 2005 16:14:17 -0400 > > 主题: Re: appending key-value pairs to a dict > > > > rbt wrote: > > > I know how to setup an empty list and loop thru > > something... appending > > > to the list on each loop... how does this work > > with dicts? > > > > > > I'm looping thru a list of files and I want to put > > the file's name and > > > its sha hash into a dict on each loop. > > > > Like so: > > > > d = {} > > for filename in files: > > d[sha_func(filename)] = filename > > > > > > Or like so: > > > > d = dict([(sha_func(filename), filename) for > > filename in files]) > > > > -- > > Brian Beck > > Adventurer of the First Order > > > > > 发件人: Skip Montanaro <[EMAIL PROTECTED]> > > 抄送: python-list@python.org > > 收件人: Steve Holden <[EMAIL PROTECTED]> > > 日期: Fri, 20 May 2005 15:16:49 -0500 > > 主题: Re: Comparing 2 similar strings? > > > > > > Steve> (is this the same as 'Conchobar'?) > > > > No, that's a trendy pub in Key West... > > > > <wink> > > > > Skip > > > > > 发件人: Paul Rubin <http://[EMAIL PROTECTED]> > > 收件人: python-list@python.org > > 日期: 20 May 2005 13:15:48 -0700 > > 主题: Re: Is Python suitable for a huge, enterprise > > size app? > > > > "Fredrik Lundh" <[EMAIL PROTECTED]> writes: > > > this has been reported before, and it won't get > > fixed (unless you're > > > volunteering to add Python-compatible garbage > > collection to Tk, that is). > > > > Yeah, I think I understand what the issue is. I can > > think of some > > kludgy possible fixes but I assume they've been > > thought about already > > and rejected. The workaround of making the > > application save an extra > > reference isn't too bad, but all relevant docs that > > say anything about > > these images should mention the requirement > > emphatically. > > > > > 发件人: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > 收件人: python-list@python.org > > 日期: 20 May 2005 13:18:33 -0700 > > 主题: Re: buffer_info error > > > > i am filling in a packet with source and destination > > address and using > > the buffer_info call to pass on the address to an > > underlying low level > > call. > > > > The src and dest are strings, but buffer_info > > expects an array. How do > > i deal with this? > > > > > > > 发件人: James Stroud <[EMAIL PROTECTED]> > > 收件人: python-list@python.org > > 日期: Fri, 20 May 2005 13:20:48 -0700 > > 主题: Re: appending key-value pairs to a dict > > > > On Friday 20 May 2005 01:04 pm, rbt wrote: > > > I know how to setup an empty list and loop thru > > something... appending > > > to the list on each loop... how does this work > > with dicts? > > > > > > I'm looping thru a list of files and I want to put > > the file's name and > > > its sha hash into a dict on each loop. > > > > > > Many thanks, > > > > > > rbt > > > > Simple assignment. > > > > adict[filename] = an_sha_hash > > > > > > > > -- > > James Stroud > > UCLA-DOE Institute for Genomics and Proteomics > > Box 951570 > > Los Angeles, CA 90095 > > > > http://www.jamesstroud.com/ > > > > > 发件人: Vijay Kumar <[EMAIL PROTECTED]> > > 抄送: [EMAIL PROTECTED] > > 收件人: python-list@python.org > > 日期: Fri, 20 May 2005 14:21:33 -0600 > > 主题: From the call hook, how do I know more > > precisely what is called? > > > > Hi, > > > > I wrote a trace function using the profiling and > > tracing hooks > > provided by the python interpreter. > > > > The Python interpreter reports the calls occuring in > > the source > > program to my trace function. > > > > How can I know whether the call happened is a > > function call or method > > call and if it is a method call what is its self > > object and/or class > > is?. > > > > I receive a frame object from the interpreter for > > every call. > > > > Thanks, > > Vijay. > > > > > 发件人: Lee Harr <[EMAIL PROTECTED]> > > 收件人: python-list@python.org > > 日期: Fri, 20 May 2005 20:38:45 GMT > > 主题: Re: PyGame and Rotozoom (Sorry if OT) > > > > On 2005-05-20, J. W. McCall <[EMAIL PROTECTED]> > > wrote: > > > I'm not sure if this is off-topic, since it > > doesn't deal with Python > > > itself, but here goes: > > > > > > I'm messing around with writing a simple "game" > > where the player (a > > > crudely drawn smiley face) moves by rotating and > > moving back or forward > > > (think Resident Evil, but from an always-above > > view). After much > > > hacking, I have it working where left and right > > rotate the player sprite > > > and up always moves the sprite whichever direction > > it's facing, while > > > down is reverse. I'm using > > pygame.transform.RotoZoom(). > > > > > > My problem is that it doesn't rotate smoothly. > > When it rotates, the > > > corners of the image (just a plain white > > background) look like they're > > > hitting some barrier and making it move around. > > Think of an empty box > > > turned diagonally (so that it looks like a > > diamond, with its open end > > > facing you), and a cube in that box being turned > > while it's resting in > > > the bottom corner. I want it to rotate smoothly > > around its center, it's > > > it's not doing that. > > > > > > I'm guessing that it has something to do with me > > not setting up a Rect > > > right, but I'm not sure. Maybe this is a > > limitation of Rotozoom/Rotate? > > > > > > Any advice would be greatly appreciated. And yes, > > I'm a rank PyGame newbie. > > > > > > > > > > > You might want to try pygsear: > > http://www.nongnu.org/pygsear/ > > > > It has a RotatedImage class which takes care of > > rotating > > things for you. See the examples roti.py and > > wings.py > > for some use of rotated image sprites. > > > > > 发件人: Jp Calderone <[EMAIL PROTECTED]> > > 收件人: python-list@python.org > > 日期: Fri, 20 May 2005 20:45:00 GMT > > 主题: Re: buffer_info error > > > > On 20 May 2005 13:18:33 -0700, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > >i am filling in a packet with source and > > destination address and using > > >the buffer_info call to pass on the address to an > > underlying low level > > >call. > > > > > >The src and dest are strings, but buffer_info > > expects an array. How do > > >i deal with this? > > > > What's the low-level call you're invoking? > > > > Jp > > > > > 发件人: [EMAIL PROTECTED] (Roy Smith) > > 收件人: python-list@python.org > > 日期: 20 May 2005 16:50:39 -0400 > > 主题: Re: appending key-value pairs to a dict > > > > rbt <[EMAIL PROTECTED]> wrote: > > >I know how to setup an empty list and loop thru > > something... appending > > >to the list on each loop... how does this work with > > dicts? > > > > > >I'm looping thru a list of files and I want to put > > the file's name and > > >its sha hash into a dict on each loop. > > > > You just assign values to keys. If the key doesn't > > exist, it's > > created automagically. You want something like > > this: > > > > shaDict = {} > > for fileName in fileNameList: > > hash = generateShaHash (fileName) > > shaDict[hash] = fileName > > > > > 发件人: Dave Brueck <[EMAIL PROTECTED]> > > 收件人: python-list@python.org > > 日期: Fri, 20 May 2005 15:07:05 -0600 > > 主题: Re: Is Python suitable for a huge, enterprise > > size app? > > > > Paul Rubin wrote: > > > Dave Brueck <[EMAIL PROTECTED]> writes: > > > > > >>One thing from your experience that did resonate > > with me is that, > > >>except for ftplib and occasionally urllib (for > > basic, one-shot GETs), > > >>we don't use any of the standard library's > > "protocol" modules - partly > > >>because we had to implement our own HTTP libraries > > for performance and > > >>scalability reasons anyway, and partly because we > > had trouble figuring > > >>out e.g. all the ins and outs of > > urllib/urllib2/httplib. > > > > > > > > > What do you use for HTTPS? > > > > Hi Paul, > > > > m2crypto (plus some patches to make asynchronous SSL > > do what we needed). > > > > > And did you use the Cookie module in your > > > HTTP servers? You may have had problems without > > even being aware of > > > them (until recently if you used Cookie with its > > default settings, any > > > attacker could completely take over your server by > > sending you > > > carefully concoted cookies). > > > > Are you referring to the use of pickle for cookie > > serialization? In any case, we > > didn't use Cookie.py from the stdlib (on the > > servers, nearly everything related > > to URLs & HTTP was custom-built, with the exception > > of urlparse, for the > > aforemenioned reasons). > > > > -Dave > > > > > 发件人: John Abel <[EMAIL PROTECTED]> > > 抄送: python-list@python.org > > 日期: Fri, 20 May 2005 22:24:14 +0100 > > 主题: Re: Process monitoring > > > > gsteff wrote: > > > > >Hey, I'm working on a Python program that will > > launch some other > > >non-Python process using os.spawn (in the > > os.P_NOWAIT mode) and then > > >basically wait for it to finish (while doing some > > other stuff in the > > >interim). Normally, the new process will signal > > that it's done by > > >writing to a file, but I'd like to also find out if > > the new process > > >died unexpectedly. Anyone know any preferrable > > ways to do this? > > > > > >Greg Steffensen > > > > > > > > > > > If you're using 2.4, have a look at the subprocess > > module. > > > > J > > > > > -- > > http://mail.python.org/mailman/listinfo/python-list > I am a beginner,Can you introduce some book about > python? I am a student of china > > _________________________________________________________ > Do You Yahoo!? > 150万曲MP3疯狂搜,带您闯入音乐殿堂 > http://cn.rd.yahoo.com/mail_cn/tag/yisou/music/*http://music.yisou.com/ > 美女明星应有尽有,搜遍美图、艳图和酷图 > http://cn.rd.yahoo.com/mail_cn/tag/yisou/image/*http://image.yisou.com > 1G就是1000兆,雅虎电邮自助扩容! > http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/ -- http://mail.python.org/mailman/listinfo/python-list