Re: Python documentation too difficult for beginners

2010-11-02 Thread James Mills
On Wed, Nov 3, 2010 at 9:05 AM, Nizumzen wrote: > Are you mad? Javadoc is one of the worst examples of source code > documentation I can possibly imagine. I would go as far to say that the > Python guys should do exactly the opposite of Javadoc. For what it's worth, I concur. cheers James --

Re: Compare source code

2010-11-02 Thread Grant Edwards
On 2010-11-02, Lawrence D'Oliveiro wrote: > In message , Grant Edwards wrote: > >> On 2010-11-01, Lawrence D'Oliveiro >> wrote: >> >>> In message <8j8am4fk2...@mid.individual.net>, Peter Pearson wrote: > diff -b oldfile newfile Warning: "diff -b" won't detect changes in in

Re: Allowing comments after the line continuation backslash

2010-11-02 Thread Roy Smith
In article , Lawrence D'Oliveiro wrote: > In message , Roy Smith wrote: > > > In this case, I think I would do: > > > > styles = [("normal", "image", MainWindow.ColorsNormalList), > > ("highlighted", "highlight", MainWindow.ColorsHighlightedList), > > ("selected",

Re: Python documentation too difficult for beginners

2010-11-02 Thread Kee Nethery
> >> >> Therefore, if you truly want changes in the documentation, I suggest that, >> rather then whining to the group, you make some of the changes yourself. > > I agree up to here, with a different interpretation of the last clause. > Work within the existing system. There are currently 250 o

Re: Compare source code

2010-11-02 Thread Tim Harig
On 2010-11-02, D'Arcy J.M. Cain wrote: > "Redundant" is right. However, there is a use for such comments: > > if foo: > bar > else: > baz > if snafu: > cookie > #endif snafu > quux > #endif foo Actually, I have found similar markers

Re: Allowing comments after the line continuation backslash

2010-11-02 Thread Ben Finney
Roy Smith writes: > In article , > Lawrence D'Oliveiro wrote: > > > In message , Roy Smith wrote: > > > > > In this case, I think I would do: > > > > > > styles = [("normal", "image", MainWindow.ColorsNormalList), > > > ("highlighted", "highlight", MainWindow.ColorsHighligh

Re: Multiple cookie headers and urllib2

2010-11-02 Thread Ian Kelly
On Tue, Nov 2, 2010 at 4:50 PM, evilmrhenry wrote: > Python 2.6.4 on Ubuntu. I'm not sure if this is a bug or if I'm just doing > this wrong... > > I'm trying to include two cookies when I use urllib2 to view a page. > #Code Start > import urllib2 > > opener = urllib2.build_opener(urllib2.HTTPCoo

Re: Re: Multiple cookie headers and urllib2

2010-11-02 Thread evilmrhenry
Ian Kelly wrote: On Tue, Nov 2, 2010 at 4:50 PM, evilmrhenry > wrote: Python 2.6.4 on Ubuntu. I'm not sure if this is a bug or if I'm just doing this wrong... I'm trying to include two cookies when I use urllib2 to view a page. #Code Start

Re: Compare source code

2010-11-02 Thread Seebs
On 2010-11-02, Emile van Sebille wrote: > What is right is that there's no question that quux is subsequent to baz > in all cases barring exceptions (and assuming no tabs intermixed) Yes, but that doesn't mean it does what the programmer intended, just that it does what it does. > The apparent

Re: Compare source code

2010-11-02 Thread Seebs
On 2010-11-02, D'Arcy J.M. Cain wrote: > "Large" is no excuse for incompetency. It is in practice. > So configure it to recognize Python files and act accordingly. So far as I know, it doesn't have a feature to do this. In any event, I work around it okay. >> No, they aren't. See... That wou

Re: Compare source code

2010-11-02 Thread Seebs
On 2010-11-02, Tim Harig wrote: > This is Python's most noticable blemish outside of the community. > Everybody knows that Python is the language that forces you to use a > particular style of formatting; and, that is a turn-off for many people. Honestly, I could probably live with that; the kill

Re: Compare source code

2010-11-02 Thread D'Arcy J.M. Cain
On Wed, 3 Nov 2010 00:41:46 + (UTC) Tim Harig wrote: > On 2010-11-02, D'Arcy J.M. Cain wrote: > Actually, I have found similar markers to be useful everywhere. I don't > like the way my editor tries to fold Python code, so I started inserting > folding markers myself: > > # foo {{{ >

Re: Compare source code

2010-11-02 Thread Seebs
On 2010-11-02, Grant Edwards wrote: > Huh? Indentation is invisible? You can't see the indentation in > Python source code? The difference between tabs and spaces is invisible on a great number of the devices on which people display code. Indentation is visible, but the underlying structure of

Re: Compare source code

2010-11-02 Thread D'Arcy J.M. Cain
On 03 Nov 2010 01:20:40 GMT Seebs wrote: > However, I have probably seen all of two or three bugs ever related to > mis-indented C, and I've had various things screw up or wreck indentation Really? I have never seen bugs in C related to indentation. I have seen plenty related to braces. What I

Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread Yingjie Lan
> From: John Bond > Subject: Re: Why this result with the re module > To: "Yingjie Lan" > Cc: python-list@python.org > Date: Tuesday, November 2, 2010, 8:09 PM > On 2/11/2010 12:19 PM, Yingjie Lan > wrote: > >> From: John Bond > >> Subject: Re: Why this result with the re module > > Firstly, than

Re: Py3: Import relative path module

2010-11-02 Thread Gnarlodious
I admit I don't understand any of what was said here. Or why it is so hard what I am trying to do. I searched Google for a few hours looking for a way to import a module from an absolute path, but that was a waste of time too. To reiterate, I am trying to import a Def function from a file one leve

Re: Compare source code

2010-11-02 Thread Tim Harig
On 2010-11-03, D'Arcy J.M. Cain wrote: > On Wed, 3 Nov 2010 00:41:46 + (UTC) > Tim Harig wrote: >> On 2010-11-02, D'Arcy J.M. Cain wrote: >> Actually, I have found similar markers to be useful everywhere. I don't >> like the way my editor tries to fold Python code, so I started inserting >>

Re: Py3: Import relative path module

2010-11-02 Thread MRAB
On 03/11/2010 01:48, Gnarlodious wrote: I admit I don't understand any of what was said here. Or why it is so hard what I am trying to do. I searched Google for a few hours looking for a way to import a module from an absolute path, but that was a waste of time too. To reiterate, I am trying to

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread Chris Melville
Disagree in this case, where the whole regex matches an empty string. Greadiness will match as much as possible. So it will also match the empty strings between consecutive characters as much as possible, once we have properly defined all the unique empty strings. Because of greadiness, fewer ma

Re: Compare source code

2010-11-02 Thread Tim Harig
On 2010-11-03, Tim Harig wrote: > On 2010-11-03, D'Arcy J.M. Cain wrote: >> On Wed, 3 Nov 2010 00:41:46 + (UTC) >> Tim Harig wrote: >> Identifying the end of the block has some value. And the braces just >> make the code noisy. > > With good syntax highlighting, you don't notice them unless

Re: Compare source code

2010-11-02 Thread Seebs
On 2010-11-03, D'Arcy J.M. Cain wrote: > On 03 Nov 2010 01:20:40 GMT > Seebs wrote: >> However, I have probably seen all of two or three bugs ever related to >> mis-indented C, and I've had various things screw up or wreck indentation > Really? I have never seen bugs in C related to indentation

Re: Trouble with importing

2010-11-02 Thread Seebs
On 2010-11-02, Ben Ahrens wrote: > I did indeed continue to top-post, and you should plonk me. Edited for accuracy. Done. -s -- Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nos...@seebs.net http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures http://en.wikipedia

Re: Python documentation too difficult for beginners

2010-11-02 Thread Lawrence D'Oliveiro
In message <2010110223050345181-nizum...@mcnuggetscom>, Nizumzen wrote: > On 2010-11-02 10:42:22 +, jk said: > >> I've been coding in PHP and Java for years, and their documentation is >> concise, well structured and easy to scan. > > Are you mad? Javadoc is one of the worst examples of sour

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread MRAB
On 03/11/2010 01:41, Yingjie Lan wrote: From: John Bond Subject: Re: Why this result with the re module To: "Yingjie Lan" Cc: python-list@python.org Date: Tuesday, November 2, 2010, 8:09 PM On 2/11/2010 12:19 PM, Yingjie Lan wrote: From: John Bond Subject: Re: Why this result with the re module

Re: Python documentation too difficult for beginners

2010-11-02 Thread John Bond
My 2c: I use the ActiveState distro, and it's winhelp doco. It's generally ok and some things, like Dive Into Python, I've found excellent. But I do quite regularly find myself cursing at the vagueness of the index, and some of the content seems to require that you know it before you read i

Re: Allowing comments after the line continuation backslash

2010-11-02 Thread Robert Kern
On 2010-11-02 19:46 , Ben Finney wrote: Instead, I'd do:: styles = [ ("normal", "image", MainWindow.ColorsNormalList), ("highlighted", "highlight", MainWindow.ColorsHighlightedList), ("selected","select",MainWindow.ColorsSelectedList)] I'd go o

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread Yingjie Lan
> Your regex says "Zero or more consecutive occurrences of > something, always returning the most possible".  That's > what it does, at every position - only matching emptyness > where it couldn't match anything (findall then skips a > character to avoid overlapping/infinite empty > matches),  and

Re: *** FBI gets a warm welcome in Chicago for their EXCELLENTperformance - cheers to NEW CONS ***

2010-11-02 Thread Gunner Asch
On Tue, 02 Nov 2010 13:58:16 -0700, Rich Grise wrote: >On Tue, 02 Nov 2010 14:17:29 -0700, Gunner Asch wrote: >> >> But...shrug..there will be far less after the Great Cull > >I think some people might be surprised as to exactly _who_ gets "culled". > >Good Luck! >Rich Indeed. So stock

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread Yingjie Lan
> Matches an empty string, returns '' > > The result is therefore ['Mar', '', '', 'lam', '', ''] Thanks, now I see it through with clarity. Both you and JB are right about this case. However, what if the regex is ((.a.)*)* ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread John Bond
Could you please reconsider how would you work with this new one and see if my steps are correct? If you agree with my 7-step execution for the new regex, then: We finally found a real bug for re.findall: re.findall('((.a.)*)*', 'Mary has a lamb') [('', 'Mar'), ('', ''), ('', ''), ('', 'lam'

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread MRAB
On 03/11/2010 03:42, Yingjie Lan wrote: Matches an empty string, returns '' The result is therefore ['Mar', '', '', 'lam', '', ''] Thanks, now I see it through with clarity. Both you and JB are right about this case. However, what if the regex is ((.a.)*)* ? Actually, in hindsight, my explan

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread John Bond
On 3/11/2010 3:55 AM, John Bond wrote: Could you please reconsider how would you work with this new one and see if my steps are correct? If you agree with my 7-step execution for the new regex, then: We finally found a real bug for re.findall: re.findall('((.a.)*)*', 'Mary has a lamb') [(''

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread John Bond
On 3/11/2010 4:02 AM, MRAB wrote: On 03/11/2010 03:42, Yingjie Lan wrote: Matches an empty string, returns '' The result is therefore ['Mar', '', '', 'lam', '', ''] Thanks, now I see it through with clarity. Both you and JB are right about this case. However, what if the regex is ((.a.)*)* ?

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread Yingjie Lan
--- On Wed, 11/3/10, John Bond wrote: > Just to clarify - findall is returning: > > [ (only match in outer group, 1st match in inner group) > , (only match in outer group, 2nd match in inner group) > , (only match in outer group, 3rd match in inner group) > , (only match in outer group, 4th mat

Py3: decode subprocess output

2010-11-02 Thread Gnarlodious
Under Python 2.6, commands.getoutput returns text type str containing ANSI Terminal formatting hex characters: "\x1b[1;31mSun : \x1b[1;36m114.902\x1b[0m - 0\xf800' (-)\x1b[1;33m I have a system for parsing out the relevant parts and I prefer to keep using that system. Under Python 3, subproces

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread Yingjie Lan
--- On Wed, 11/3/10, MRAB wrote: > From: MRAB > Subject: Re: Must be a bug in the re module [was: Why this result with the re > module] > To: python-list@python.org > Date: Wednesday, November 3, 2010, 8:02 AM > On 03/11/2010 03:42, Yingjie Lan > wrote: > Therefore the outer (first) group is a

Re: Allowing comments after the line continuation backslash

2010-11-02 Thread Ben Finney
Robert Kern writes: > I'd go one step further: > > styles = [ > ("normal", "image", MainWindow.ColorsNormalList), > ("highlighted", "highlight", MainWindow.ColorsHighlightedList), > ("selected","select",MainWindow.ColorsSelectedList), > ] > > Keepi

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread John Bond
OK, I've got that, and I have no problem with the capturing part. My real problem is with the number of total matches. *I think it should be 4 matches in total but findall gives 6 matches*, for the new regex '((.a.)*)*'. I'd love to know what you think about this. Many thanks! Yingjie We'v

Re: Man pages and info pages

2010-11-02 Thread Teemu Likonen
* 2010-11-02 19:36 (UTC), Tim Harig wrote: > On 2010-11-02, Teemu Likonen wrote: >> There is also the problem that people are less familiar with info >> browsers than the usual "less" pager which is used by "man" command. > > I thoroughly agree. The default info viewers are quite possibly the > m

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread John Bond
On 3/11/2010 4:23 AM, Yingjie Lan wrote: --- On Wed, 11/3/10, MRAB wrote: From: MRAB Subject: Re: Must be a bug in the re module [was: Why this result with the re module] To: python-list@python.org Date: Wednesday, November 3, 2010, 8:02 AM On 03/11/2010 03:42, Yingjie Lan wrote: Therefore th

Coca Cola Scholarship: Are You Qualified?

2010-11-02 Thread PHP.CCC
Coca Cola Scholarship: Are You Qualified? Before you apply for Coca Cola scholarship, here are the things you should know: Coca-Cola Scholars Foundation programs There are two types of Coca-Cola Scholars Foundation programs: ·2-Year Colleges Scholarship Program · Scholars Program for high school s

Re: Man pages and info pages

2010-11-02 Thread Tim Harig
On 2010-11-03, Teemu Likonen wrote: > * 2010-11-02 19:36 (UTC), Tim Harig wrote: >> I thoroughly agree. The default info viewers are quite possibly the >> most counterintuitive programs I have ever encountered. I never did >> bother to learn how to use them. I instead installed the more >> intuiti

Re: Python documentation too difficult for beginners

2010-11-02 Thread rantingrick
AD i agree with you! The official python tutorial and the official docs are pretty much a twisted mass of confusion to the initiated programmer. Even today when i try yo search the docs i find the result quite frankly useless. And the search reminds me of the old XP "puppy dog" search. The doc AR

Re: Mail Merge from python data

2010-11-02 Thread Tim Harig
This page didn't make it to through to my nntp server so I appologize if I miss something that was covered. On 2010-11-03, Dennis Lee Bieber wrote: > On Tue, 2 Nov 2010 20:32:13 +1000, Dylan Evans > declaimed the following in gmane.comp.python.general: > >> I'm setting up a database for an organ

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread Yingjie Lan
--- On Wed, 11/3/10, John Bond wrote: >3) then said there must be >=0 occurrences of what's inside it, >which of course there is, so that has no effect. > >((.a.)*)* Hi, I think there should be a difference: unlike before, now what's inside the outer group can match an empty s

Re: text file reformatting

2010-11-02 Thread iwawi
On Nov 1, 6:50 pm, "cbr...@cbrownsystems.com" wrote: > On Nov 1, 1:58 am, iwawi wrote: > > > > > > > On 1 marras, 09:59, "cbr...@cbrownsystems.com" > > > wrote: > > > On Oct 31, 11:46 pm, iwawi wrote: > > > > > On 31 loka, 21:48, Tim Chase wrote: > > > > > > > PRJ01001 4 00100END > > > > > > P

How to highlight Label/Text in tkinter ?

2010-11-02 Thread VGNU Linux
Hi, I am writing a program teach myself python and tkinter. Below given is a program which displays label with different fonts and sizes. How to highlight text and change font size if the up/down arrow keys are pressed ? from Tkinter import * import tkFont class MyFrame(Frame): def __init__(s

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-02 Thread Yingjie Lan
--- On Wed, 11/3/10, John Bond wrote: > I just explained that (I think!)! The outer capturing group > uses > repetition, so it returns the last thing that was matched > by the inner > group, which was an empty string. > According to yourself, the last match of the inner group is also empt

<    1   2