<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT color=#000000><SPAN style="FONT-FAMILY: Tahoma"><FONT size=3>Is there a Python programmer living near Bend Oregon that I could call via phone & ask some questions on how they accomplish certain tasks?<SPAN style="mso-spacerun: yes">  </SPAN>I’ve been programming using several languages for over fifty years, but am unable to get Python to due what I would like to do!</FONT></SPAN><SPAN style="FONT-SIZE: 18pt; mso-bidi-font-size: 12.0pt"><FONT face="Times New Roman"> <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></FONT></P><BR><BR>Papa Jackson<BR><BR>
<BLOCKQUOTE>
<HR id=stopSpelling>
From: python-list-request@python.org<BR>Subject: Python-list Digest, Vol 57, Issue 206<BR>To: python-list@python.org<BR>Date: Fri, 13 Jun 2008 19:00:04 +0200<BR><BR><PRE>Send Python-list mailing list submissions to<BR>    python-list@python.org<BR> <BR>To subscribe or unsubscribe via the World Wide Web, visit<BR>  <A href="http://mail.python.org/mailman/listinfo/python-list" target=_blank>http://mail.python.org/mailman/listinfo/python-list</A><BR>or, via email, send a message with subject or body 'help' to<BR>       python-list-request@python.org<BR> <BR>You can reach the person managing the list at<BR>      python-list-owner@python.org<BR> <BR>When replying, please edit your Subject line so it is more specific<BR>than "Re: Contents of Python-list digest..."<BR></PRE>
<BLOCKQUOTE>--Forwarded Message Attachment--<BR>From: sri_annauni@yahoo.co.in<BR>To: python-list@python.org<BR>Date: Fri, 13 Jun 2008 21:59:06 +0530<BR>Subject: Python Socket programming<BR><BR><PRE>Hi,<BR>I am going to do some socket related programming in Python. Before that, I wish to know the Gotchas of Python Scoket Programming.<BR>Can anyone send me any link that satisfies my needs??<BR>Thanks,<BR>Srini<BR> <BR> <BR>      Explore your hobbies and interests. Go to <A href="http://in.promos.yahoo.com/groups/" target=_blank>http://in.promos.yahoo.com/groups/</A><BR> <BR></PRE></BLOCKQUOTE>
<BLOCKQUOTE>--Forwarded Message Attachment--<BR>From: jaraco@jaraco.com<BR>CC: python-list@python.org<BR>To: ironfroggy@socialserve.com<BR>Date: Fri, 13 Jun 2008 10:28:45 -0600<BR>Subject: RE: namedtuple suggestions<BR><BR><PRE>I also agree with your point on concatting.  I used that syntax because it<BR>seemed more clear, given the already awkward syntax.<BR> <BR>And while the original motivation of namedtuple might be to avoid having to<BR>make a class or subclass, subclasses have already emerged even within the<BR>standard library (see lib/urlparse for a prime example of extending the<BR>namedtuple class).<BR> <BR>Regards,<BR>Jason<BR> <BR>-----Original Message-----<BR>From: Calvin Spealman [mailto:ironfroggy@socialserve.com] <BR>Sent: Friday, 13 June, 2008 12:17<BR>To: Jason R. Coombs<BR>Cc: python-list@python.org<BR>Subject: Re: namedtuple suggestions<BR> <BR>On Jun 13, 2008, at 11:17 AM, Jason R. Coombs wrote:<BR> <BR>> I see a new function in (python 2.6) lib/collections called<BR>> namedtuple.  This is a great function.  I can see many places in my<BR>> code where this will be immensely useful.<BR>><BR>> I have a couple of suggestions.<BR>><BR>> My first suggestion is to use self.__class__.__name__ instead of the<BR>> hard-coded typename in __repr__, so that subclasses don't have to<BR>> override these methods just to use the correct name.<BR>><BR>>         def __repr__(self):<BR>>             return self.__class__.__name__ + '(%(reprtxt)s)' %% self<BR>> \n<BR> <BR>I feel like a large point of NamedTuple is for those cases where you  <BR>need a small object with some attributes _without_ creating a  <BR>subclass. Useful for mocks, for example, or when you need to trick a  <BR>function into dealing with a quick proxy or stub. If a large point is  <BR>not needing to create a class but instead creating a cheap object,  <BR>should it be a good idea to then subclass the very thing that was  <BR>intended to help you avoid creating a class in the first place? What  <BR>do you gain subclassing it?<BR> <BR>However, I always think a repr reflecting a type name should reflect  <BR>the correct type, so I'm not disagreeing on that point. But, just  <BR>don't use concating :-)<BR></PRE></BLOCKQUOTE>
<BLOCKQUOTE>--Forwarded Message Attachment--<BR>From: dstromberglists@gmail.com<BR>To: python-list@python.org<BR>Date: Fri, 13 Jun 2008 16:41:46 +0000<BR>Subject: Automatically restarting system calls?<BR><BR><PRE> <BR>I wrote a script(1) replacement in python (<A href="http://stromberg.dnsalias.org/" target=_blank>http://stromberg.dnsalias.org/</A><BR>~dstromberg/pypty/), but I'm encountering a problem in it.<BR> <BR>I think I know the solution to the problem, but I'd've thought python was <BR>high level enough that this solution isn't required, so I wanted to <BR>inquire about it here.<BR> <BR>Specifically, the program has a signal handler for window size changes.  <BR>And if the window is resized during an os.write() (for example), I get a <BR>python exception about needing to restart the system call.<BR> <BR>In C, I know you're supposed to wrap your system calls with while loops <BR>until you don't get an ERESTART, but does one really need to wrap all of <BR>one's os.write()'s (for example) with such while loops in python?<BR> <BR>Thanks!<BR> <BR> <BR></PRE></BLOCKQUOTE>
<BLOCKQUOTE>--Forwarded Message Attachment--<BR>From: omer@no-log.org<BR>To: python-list@python.org<BR>Date: Fri, 13 Jun 2008 18:46:46 +0200<BR>Subject: Re: Python Socket programming<BR><BR><PRE>Hi,<BR> <BR>Le Friday 13 June 2008 18:29:06 srinivasan srinivas, vous avez écrit :<BR>> Hi,<BR>> I am going to do some socket related programming in Python. Before that, I<BR>> wish to know the Gotchas of Python Scoket Programming. Can anyone send me<BR>> any link that satisfies my needs??<BR> <BR>Yes, the friendly manual :)<BR> <BR><A href="http://docs.python.org/lib/module-socket.html" target=_blank>http://docs.python.org/lib/module-socket.html</A><BR> <BR>and if you want to know more about socket themselves, the gnu libc info page <BR>is a good starting point as the python module is basically an interface to <BR>it:<BR> <BR><A href="http://www.gnu.org/software/libc/manual/html_node/Sockets.html#Sockets" target=_blank>http://www.gnu.org/software/libc/manual/html_node/Sockets.html#Sockets</A><BR> <BR>-- <BR>Cédric Lucantis<BR> <BR></PRE></BLOCKQUOTE>
<BLOCKQUOTE>--Forwarded Message Attachment--<BR>From: maric@aristote.info<BR>To: python-list@python.org<BR>Date: Fri, 13 Jun 2008 18:55:24 +0200<BR>Subject: Re: Summing a 2D list<BR><BR><PRE>Hello,<BR> <BR>Le Friday 13 June 2008 17:55:44 Karsten Heymann, vous avez écrit :<BR>> Maric Michaud <maric@aristote.info> writes:<BR>> > So, writing C in python, which has dictionnary as builtin type,<BR>> > should be considered "more elegant" ?<BR>><BR>> IMO that's a bit harsh.<BR>><BR> <BR>harsh ? Sorry, I'm not sure to understand.<BR> <BR>> > You are comparing apples with lemons, there is no such a difference<BR>> > between list index access and dictionnary key access in Python.<BR>><BR>> [...]<BR>><BR>> > If you know in advance the number and names of users, what prevent<BR>> > you to initialize completelly the target dictionnary ?<BR>> ><BR>> > The following code compare the same algorithm, once with list and<BR>> > the second time with dict :<BR>><BR>> [...]<BR>><BR>> > The result is pretty close now :<BR>> ><BR>> > maric@redflag1 17:04:36:~$ ./test.py<BR>> > with list 1.40726399422<BR>> > with dict 1.63094091415<BR>> ><BR>> > So why use list where the obvious and natural data structure is a<BR>> > dictionnary ?<BR>><BR>> I'd never argue that using a dictionary is the obvious and natural<BR>> data structure for this case. But is it the best? Honestly, as your<BR>> very nice example shows, we have two solutions that are equally fast,<BR>> equally complex to code and equally robust, but one needs<BR> <BR>Yes, but my example take ordered integer for keys (users' names)  which they <BR>should not be in a real case, so retrieving the result is by way easier (and <BR>faster) with a dictionnary.<BR> <BR>> approximately the double amount of memory compared to the other. <BR> <BR>I don't see how you came to this conclusion. Are you sure the extra list take <BR>twice more memory than the extra dictionary ?<BR> <BR>> So, as much as i like dictionaries, what's the gain you get from using it<BR>> in this corner case?<BR> <BR>It's the very purpose of it's usage, store and retrieve data by key.<BR> <BR>Cheers,<BR> <BR>-- <BR>_____________<BR> <BR>Maric Michaud<BR> <BR></PRE></BLOCKQUOTE>
<BLOCKQUOTE>--Forwarded Message Attachment--<BR>From: maric@aristote.info<BR>To: python-list@python.org<BR>Date: Fri, 13 Jun 2008 18:59:02 +0200<BR>Subject: Re: Summing a 2D list<BR><BR><PRE>Le Friday 13 June 2008 18:55:24 Maric Michaud, vous avez écrit :<BR>> > approximately the double amount of memory compared to the other.<BR>><BR>> I don't see how you came to this conclusion. Are you sure the extra list<BR>> take twice more memory than the extra dictionary ?<BR> <BR>twice less, I meant, of course...<BR> <BR>-- <BR>_____________<BR> <BR>Maric Michaud<BR> <BR></PRE></BLOCKQUOTE>
<BLOCKQUOTE>--Forwarded Message Attachment--<BR>From: mccredie@gmail.com<BR>To: python-list@python.org<BR>Date: Fri, 13 Jun 2008 09:55:04 -0700<BR>Subject: Re: weird iteration/assignment problem<BR><BR><PRE>On Jun 13, 8:07 am, "Diez B. Roggisch" <de...@nospam.web.de> wrote:<BR>> cirfu schrieb:<BR>><BR>> > for i in xrange(0, len(texts)):<BR>> >         texts[i] = "yes"<BR>><BR>> > for i in texts:<BR>> >     i = "no"<BR>><BR>> > why is the first one working but not the second. i mean i see why the<BR>> > firts one works but i dont udnerstand why the second doesnt.<BR>><BR>> Because in the second you only bind the contents of texts to a name i.<BR>><BR>> But that doesn't mean that i magically became an "alias" for<BR>> texts[index] - it just happens to point at the same object.<BR>><BR>> To accomplish what you want, the pythonic idiom is to use enumerate:<BR>><BR>> for i, text in enumerate(texts):<BR>>      text[i] = "yes"<BR>><BR>> Diez<BR> <BR>That should be:<BR> <BR>for i, text in enumerate(texts):<BR>     texts[i] = "yes"<BR> <BR> <BR> <BR></PRE></BLOCKQUOTE></BLOCKQUOTE></body>
</html>