Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Ben Finney
Steven D'Aprano writes: > Source code is, *by definition*, the definitive version. (It's the > SOURCE, see?) Zipping the source code just means that the *source* > inside the zip file is the definitive version, not the compressed > binary data. I find the Free Software Foundation has a good, cle

Re: IndexError: pop from empty list

2014-05-15 Thread Steven D'Aprano
On Thu, 15 May 2014 21:36:49 -0700, chris wrote: > Any ideas about what this might mean? [jumping ahead] > digital_data_set = (sample_bytes.pop(0) << 8 | sample_bytes.pop(0)) > IndexError: pop from empty list sample_bytes is an empty list. Or it could be a list with just a single sample. You

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Steven D'Aprano
On Thu, 15 May 2014 17:12:57 +0300, Marko Rauhamaa wrote: > A definitive Python source file could be binary, XML, .py, .ast, > whatever, Containing *what*? You can't just wave your hands and say "binary". What sort of binary file? Perhaps a JPEG file, where red triangles of different sizes rep

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Ben Finney
Rustom Mody writes: > You said this: > > > The 80 character line limit is *not* driven by a limitation of > > computer technology; it is driven by a limitation of human > > cognition. For that reason, it remains relevant until human > > cognition in the general reading population improves. > > An

Re: IndexError: pop from empty list

2014-05-15 Thread chris
No, that was pretty much what I was looking for. If anyone has an answer to the deeper question, that would be icing on the cake. What is interesting is that usually the traceback shows the line of code that I invoke which, deep inside a library I'm using, has generated an error. In this case

Re: socket client and server in one application?

2014-05-15 Thread chris
Thank you all. The 2 threaded in/out sockets are working great. I'm receiving input on the xbee/serial port in the dispatch thread. For each receipt I send the xbee data through a socket connected to node-red. Node-red is collecting the data, parsing it and sending it along to other end poi

Re: IndexError: pop from empty list

2014-05-15 Thread Gary Herron
On 05/15/2014 09:36 PM, ch...@freeranger.com wrote: Any ideas about what this might mean? Running Debian Wheezy on a RaspBerry Pi and collecting data on a dispatch thread that is reading input on the serial port (connected to xbee series 1). It happens every few days but it really chokes the p

IndexError: pop from empty list

2014-05-15 Thread chris
Any ideas about what this might mean? Running Debian Wheezy on a RaspBerry Pi and collecting data on a dispatch thread that is reading input on the serial port (connected to xbee series 1). It happens every few days but it really chokes the program. Thanks for any tips, ChrisJ Exception in

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Rustom Mody
On Friday, May 16, 2014 5:51:21 AM UTC+5:30, Ben Finney wrote: > > > Rather, I've claimed that the conventional lime length limit is *based > in* the real cognitive limits of human reading comprehension -- and that > technologies have been designed with corresponding limitations. > > > Nowhere

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Steven D'Aprano
On Thu, 15 May 2014 06:58:53 -0700, Rustom Mody wrote: > As far as I can see the votaries of the mystical 79 have yet to explain > how/where it appeared from You're either trolling, or haven't been reading this thread in any detail. That's already been explained, repeatedly both in this thread a

Re: Directory Caching, suggestions and comments?

2014-05-15 Thread Cameron Simpson
On 15May2014 15:34, Benjamin Schollnick wrote: I am going to be using this code as part of a web system, and I would love any feedback, comments and criticism. [...] I am using scandir from benhoyt to speed up the directory listings, and data collection. [...] I had considered using OrderedDicts

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Steven D'Aprano
On Thu, 15 May 2014 16:07:54 +0300, Marko Rauhamaa wrote: > Johannes Bauer : > >> I don't know why anyone would force a display issue onto everyone. > > Well, if I have to work with your code, you are forcing your style on > me. +1 >> It imples the arrogant stance that every human being has t

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Ben Finney
Rustom Mody writes: > The claim being made is that 79/80 is a fundamental, cognitive limit > and has no relation to technological changes. Who has made that claim, and where? You appear to be attacking a straw man. Rather, I've claimed that the conventional lime length limit is *based in* the r

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Rustom Mody
On Friday, May 16, 2014 3:51:27 AM UTC+5:30, Terry Reedy wrote: > On 5/15/2014 9:58 AM, Rustom Mody wrote: > > > > As far as I can see the votaries of the mystical 79 have yet to explain > > how/where it appeared from > > > > As has been explained before, and is implied in the PEP, 79 = 80 - 1

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread MRAB
On 2014-05-15 22:50, Terry Reedy wrote: On 5/15/2014 10:42 AM, Chris Angelico wrote: Impossible to say, and one of the perpetual annoyances. Here's a web site that I host: http://gilbertandsullivan.org.au/index.php?option=com_content&view=article&id=92:2001-patience&catid=30:patience&Itemid=10

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Ben Finney
Johannes Bauer writes: > On 15.05.2014 04:43, Ben Finney wrote: > > Rustom Mody writes: > > > >> Until then may we relegate '79' to quaint historical curiosities > > > > Not until the general capacity of human cognition advances to make > > longer lines easier to read. > > I find it surprising

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Terry Reedy
On 5/15/2014 9:58 AM, Rustom Mody wrote: As far as I can see the votaries of the mystical 79 have yet to explain how/where it appeared from As has been explained before, and is implied in the PEP, 79 = 80 - 1. 80 chars - 1 character width cursor leaves 79 non-cursor characters. When is hit,

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Terry Reedy
On 5/15/2014 10:42 AM, Chris Angelico wrote: Impossible to say, and one of the perpetual annoyances. Here's a web site that I host: http://gilbertandsullivan.org.au/index.php?option=com_content&view=article&id=92:2001-patience&catid=30:patience&Itemid=102 (Tiny URL: http://tinyurl.com/pphpkuk

Re: Bug in Decimal??

2014-05-15 Thread Mark H Harris
On 5/15/14 3:45 PM, pleasedonts...@isp.com wrote: Please take a deeper look at my second post. Try the same but this time set the precision to 4000, 8000 or whatever you need to convince yourself there's no error propagation, yet there's a 4 in the middle that shouldn't be there. See for yours

Re: Bug in Decimal??

2014-05-15 Thread pleasedontspam
On Sunday, May 4, 2014 6:53:06 AM UTC-4, Mark Dickinson wrote: > I had a quick look: this isn't a bug - it's just the result of propagation of > > the error in "partial" to "final". > > > > In more detail: we've got a working precision of 2016 significant figures. > For > > any small x, we

Re: Directory Caching, suggestions and comments?

2014-05-15 Thread Chris Angelico
On Fri, May 16, 2014 at 5:34 AM, Benjamin Schollnick wrote: > Just as a side note, I'm not completely PEP 8. I know that, I use a > slightly laxer setting in pylint, but I'm working my way up to it... > > I am using scandir from benhoyt to speed up the directory listings, and data > collection.

Directory Caching, suggestions and comments?

2014-05-15 Thread Benjamin Schollnick
Folks, I am going to be using this code as part of a web system, and I would love any feedback, comments and criticism. Just as a side note, I'm not completely PEP 8. I know that, I use a slightly laxer setting in pylint, but I'm working my way up to it... I am using scandir from benhoyt to spe

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread alister
On Thu, 15 May 2014 23:44:34 +1000, Chris Angelico wrote: > On Thu, May 15, 2014 at 11:38 PM, alister > wrote: >> On Thu, 15 May 2014 23:31:44 +1000, Chris Angelico wrote: >>> The Windows 8 / Unity / GNOME 3 model annoys me greatly. Can't get >>> work done like that. >>> >>> ChrisA >> Windows 8/

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Mark Lawrence
On 15/05/2014 14:58, Roy Smith wrote: In article <78ac407a-c429-4a7a-93c9-5d83e0f09...@googlegroups.com>, Rustom Mody wrote: And yet programmers continue to be decades behind all other users of computers. We continue to use flat text for our programs when all others have moved on. It's no

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread wxjmfauth
Le jeudi 15 mai 2014 16:27:16 UTC+2, Chris Angelico a écrit : > On Fri, May 16, 2014 at 12:17 AM, wrote: > > > One another trick is to drop spaces around keywords > > > > > 9and 12345or 99if 'a'in'a' else or 77 > > > 12345 > > > > > > and pray, the tools from th

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Chris Angelico
On Fri, May 16, 2014 at 12:36 AM, Marko Rauhamaa wrote: > You and I could have opened the same C file. Only you see: > >#include > >int ++ >main ( int argc, | My first C program | > char *cons

Re: struct.unpack: why 's' fmt char convert to bytestring

2014-05-15 Thread MRAB
On 2014-05-15 13:34, GuoChao wrote: T he Python documentation gives this same example: record = b'raymond\x32\x12\x08\x01\x08' name, serialnum, school, gradelevel = unpack('<10sHHb', record) but get different results as to 's', don't kn

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Chris Angelico
On Fri, May 16, 2014 at 12:29 AM, Marko Rauhamaa wrote: > An everyday example: a word processor displays the word "hello" with > "hel" in boldface and "lo" in italics. You put the cursor between the > l's and type a letter. Should it be in boldface or italics? Impossible to say, and one of the pe

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Marko Rauhamaa
Chris Angelico : > I believe the Python interpreter happily accepts a zip file, which in > theory could be edited directly by a competent text editor. But that > has nothing to do with PEP 8. Compare a classic compiled language like > C - you have the bit you edit (the C source code) and the "defi

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Skip Montanaro
On Thu, May 15, 2014 at 9:29 AM, Marko Rauhamaa wrote: > Who of you hasn't sworn at a Web editor that gets the formatting all > messed up when you have typed a backspace in the "wrong place?" My current pet peeve is the Gmail composition pane. What a load of crap (especially in rich text mode).

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Chris Angelico
On Fri, May 16, 2014 at 12:17 AM, wrote: > One another trick is to drop spaces around keywords > 9and 12345or 99if 'a'in'a' else or 77 > 12345 > > and pray, the tools from those who are wasting their time in > writing code analyzers or syntax colorizers or doc strings

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Marko Rauhamaa
Rustom Mody : > And yet you routinely find people on this list recommending writing > python to using a GUI-builder. On the one hand I am tempted to say > "Sheesh!!" On the other, maybe the builders are still too > half-assed... Dunno That's like diagnosing cancer without invasive procedures, lab

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Chris Angelico
On Fri, May 16, 2014 at 12:12 AM, Marko Rauhamaa wrote: > A definitive Python source file could be binary, XML, .py, .ast, > whatever, and that would also be the file fed to the Python > compiler/interpreter. However, your editor could choose freely how to > present it to you. > > IOW, shouldn't P

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread wxjmfauth
Le mardi 13 mai 2014 10:45:49 UTC+2, Peter Otten a écrit : > Ganesh Pal wrote: > > > > > Hi Team , > > > > > > > > > what would be the best way to intent the below line . > > > > > > I have few lines in my program exceeding the allowed maximum line Length > > > of 79./80 characters >

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Rustom Mody
On Thursday, May 15, 2014 7:28:01 PM UTC+5:30, Roy Smith wrote: > > Rustom Mody wrote: > > > > > And yet programmers continue to be decades behind all other users of > > computers. We continue to use flat text for our programs when all others > > have moved on. > > > > It's not like we h

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Marko Rauhamaa
Rustom Mody : > We continue to use flat text for our programs when all others have > moved on. My more moderate and immediate point is, why should the physical encoding of the program be also the presentation format? A definitive Python source file could be binary, XML, .py, .ast, whatever, and

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Chris Angelico
On Thu, May 15, 2014 at 11:58 PM, Roy Smith wrote: > There *are* some places where non-text programming has won. The biggest > example would be GUI builders. Nobody programs screen and window > layouts by typing textual descriptions. They push boxes around in a GUI > builder. Hi, I'm Nobody, a

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Rustom Mody
On Thursday, May 15, 2014 6:57:26 PM UTC+5:30, Chris Angelico wrote: > The limit of human readability is generally given to be somewhere in > the range of 60-120. It's not a single specific value that's exactly > the same for everyone; personally, I like my lines of code to be a bit > longer than 8

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Roy Smith
In article <78ac407a-c429-4a7a-93c9-5d83e0f09...@googlegroups.com>, Rustom Mody wrote: > And yet programmers continue to be decades behind all other users of > computers. We continue to use flat text for our programs when all others > have moved on. It's not like we haven't tried. There hav

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Rustom Mody
On Thursday, May 15, 2014 6:37:54 PM UTC+5:30, Marko Rauhamaa wrote: > Johannes Bauer : > > > > I don't know why anyone would force a display issue onto everyone. > > > Well, if I have to work with your code, you are forcing your style on > me. > > > > It imples the arrogant stance that every

Re: struct.unpack: why 's' fmt char convert to bytestring

2014-05-15 Thread Dave Angel
On 05/15/2014 08:34 AM, GuoChao wrote: The Python documentation gives this same example:>>> record = b'raymond \x32\x12\x08\x01\x08' name, serialnum, school, gradelevel = unpack('<10sHHb', record) but get different results as to 's', don't know why this change in Python 3? need extra work

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Chris Angelico
On Thu, May 15, 2014 at 11:38 PM, alister wrote: > On Thu, 15 May 2014 23:31:44 +1000, Chris Angelico wrote: >> The Windows 8 / Unity / GNOME 3 model annoys me greatly. Can't get work >> done like that. >> >> ChrisA > Windows 8/ Unity/ Gnome 3 are great on tablets (at least they look like > they s

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread alister
On Thu, 15 May 2014 23:31:44 +1000, Chris Angelico wrote: > The Windows 8 / Unity / GNOME 3 model annoys me greatly. Can't get work > done like that. > > ChrisA Windows 8/ Unity/ Gnome 3 are great on tablets (at least they look like they should be the only one I can confirm is Win 8) but lousy on

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Chris Angelico
On Thu, May 15, 2014 at 11:07 PM, Marko Rauhamaa wrote: > I know the idea of "windows" is fast disappearing from modern > ("mobile") computing; you have "apps" instead that commandeer the whole > screen. Personally, I find that a big step backwards. I want to be able > to subdivide the screen for

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Chris Angelico
On Thu, May 15, 2014 at 10:32 PM, Johannes Bauer wrote: > Personally I find overly narrow code (80 cols) to be much *harder* to > read than code that is 100 cols wide. Keep in mind that even if the > break is at 100 cols, lines will rarely exceed that limit. And if they > do to *understand* the co

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Marko Rauhamaa
Johannes Bauer : > I don't know why anyone would force a display issue onto everyone. Well, if I have to work with your code, you are forcing your style on me. > It imples the arrogant stance that every human being has the exact way > of reading and writing code. Everyone can configure her edito

struct.unpack: why 's' fmt char convert to bytestring

2014-05-15 Thread GuoChao
The Python documentation gives this same example:>>> record = b'raymond \x32\x12\x08\x01\x08' >>> name, serialnum, school, gradelevel = unpack('<10sHHb', record) but get different results as to 's', don't know why this change in Python 3? need extra work to encode...>>> name >>> 'raymond '

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Johannes Bauer
On 15.05.2014 04:43, Ben Finney wrote: > Rustom Mody writes: > >> Until then may we relegate '79' to quaint historical curiosities > > Not until the general capacity of human cognition advances to make > longer lines easier to read. I find it surprising how you can make such a claim about the w

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-15 Thread Rustom Mody
On Thursday, May 15, 2014 4:55:42 PM UTC+5:30, Simon Evans wrote: > Dear Programmers, > > As anticipated, it has not been to long before I have encountered further > > difficulty. At the top of page 16 of 'Getting Started with Beautiful Soup" it > > gives code to be input, whether to the Pytho

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Dave Angel
On 05/14/2014 10:12 PM, Roy Smith wrote: In article , Mark Lawrence wrote: I still remember the cry of anguish when the guy in the computer building at (the then) Portsmouth Polytechnic dropped his cardboard box of punch cards that made up his end of course project. That's why you punch se

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-15 Thread Dave Angel
On 05/15/2014 07:30 AM, Simon Evans wrote: Dear Programmers, I noticed a couple of typos in my previous message, so have now altered them thus :- Dear Programmers, As anticipated, it has not been to long before I have encountered further difficulty. Your first thread was about getting Beauti

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-15 Thread Simon Evans
Dear Programmers, I noticed a couple of typos in my previous message, so have now altered them thus :- Dear Programmers, As anticipated, it has not been to long before I have encountered further difficulty. At the top of page 16 of 'Getting Started with Beautiful Soup" it gives code to be in

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-15 Thread Simon Evans
Dear Programmers, As anticipated, it has not been to long before I have encountered further difficulty. At the top of page 16 of 'Getting Started with Beautiful Soup" it gives code to be input, whether to the Python or Windows command prompt I am not sure, but both seem to be resistant to

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-15 Thread Simon Evans
Dear Programmers, I downloaded Peazip, which doesn't remove file/ folder hierarchy. I unzipped it and input the same code to the console and it installed Beautiful Soup 4 okay re:- - Microsoft Windows [Version 6.1.76