Re: expression in an if statement

2010-08-20 Thread alex23
John Nagle wrote: > I was talking to the Facebook guys doing the compiler for PHP, and they > said that it was a huge win for them that PHP doesn't allow dynamically > replacing a function. I'm not sure if I call all that effort for a 50% speed increase a win. PyPy is seeing speed increases of up

Re: scope of variable

2010-08-20 Thread John Nagle
On 8/20/2010 12:56 PM, M B wrote: fre 2010-08-20 klockan 13:19 -0600 skrev Burton Samograd: M B writes: Hi, dept=0 def mud(): print dept mud() 0 def mud(): dept+=1 print dept You should add a global statement or else python thinks a variable used is a

Re: Iterative vs. Recursive coding

2010-08-20 Thread John Nagle
On 8/20/2010 1:17 PM, John Bokma wrote: John Nagle writes: Python does not do tail recursion, so using recursion where iteration could do the job is generally a bad idea. Scheme, on the other hand, always does tail recursion where possible. I think you mean tail recursion optimization

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread Tim Golden
On 20/08/2010 11:54 PM, vsoler wrote: I'am testing your library. I am mainly interested in knowing the access attributes of directories in the local(C:\) or shared unit(W:\) of my system. Using your script with 'c:\\' I get an error message saying... 'file exists but it is a directory' and I can

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-20 Thread Standish P
On Aug 20, 3:51 pm, Hugh Aguilar wrote: > On Aug 18, 6:23 pm, Standish P wrote: > > > > > > > On Aug 17, 6:38 pm, John Passaniti wrote: > > > > You asked if Forth "borrowed" lists from Lisp.  It did not.  In Lisp, > > > lists are constructed with pair of pointers called a "cons cell". > > > That

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-20 Thread Standish P
On Aug 18, 8:05 pm, Elizabeth D Rather wrote: > On 8/18/10 2:23 PM, Standish P wrote: > > > On Aug 17, 6:38 pm, John Passaniti  wrote: > > >> You asked if Forth "borrowed" lists from Lisp.  It did not.  In Lisp, > >> lists are constructed with pair of pointers called a "cons cell". > >> That is th

OI VEY, I AGREE -was once [Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?]

2010-08-20 Thread Richard Owlett
John Passaniti wrote: On Aug 20, 6:51 pm, Hugh Aguilar wrote: You can see an example of lists in my novice package (in the list.4th file):http://www.forth.org/novice.html Also in there is symtab, which is a data structure intended to be used for symbol tables (dictionaries). Almost nobody uses

Re: 79 chars or more?

2010-08-20 Thread Lawrence D'Oliveiro
In message , Jean-Michel Pichavant wrote: > Saying that, if one intend to distribute its code, he should stick to 80 > chars per line. Why? -- http://mail.python.org/mailman/listinfo/python-list

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-20 Thread John Passaniti
On Aug 20, 6:51 pm, Hugh Aguilar wrote: > You can see an example of lists in my novice package (in the list.4th > file):http://www.forth.org/novice.html > Also in there is symtab, which is a data structure intended to be used > for symbol tables (dictionaries). Almost nobody uses linked lists for

Re: Problem with tarfile module to open *.tar.gz files - unreliable ?

2010-08-20 Thread m_ahlenius
On Aug 20, 12:55 pm, Peter Otten <__pete...@web.de> wrote: > m_ahlenius wrote: > > I am using Python 2.6.5. > > > Unfortunately I don't have other versions installed so its hard to > > test with a different version. > > > As for the log compression, its a bit hard to test.  Right now I may > > proc

Re: Simple Python Sandbox

2010-08-20 Thread Stephen Hansen
On 8/16/10 7:01 AM, Roland Koebler wrote: > On Sat, Aug 14, 2010 at 08:01:00PM -0700, Stephen Hansen wrote: >>> As you can see, black listing isn't the best approach here. >> >> But I have a two pronged strategy: the black list is only half of the >> equation. One, I'm blacklisting all the meta fun

Re: Pop return from stack?

2010-08-20 Thread Gregory Ewing
bvdp wrote: The whole problem I was having is that I was trying to tie a small application (an helper to the main application) to use a bit of the existing code as a pseudo-library. This is precisely the reason that it's a bad idea to directly terminate the program from somewhere deep inside t

Re: Python "why" questions

2010-08-20 Thread Gregory Ewing
Russ P. wrote: It all boils down to personal preference, but I just find it strange that we would not try to make programming as consistent as possible with notational conventions in the literature. It doesn't matter how much mathematical convention you quote, your assertion that 1-based indexi

Re: Python "why" questions

2010-08-20 Thread Gregory Ewing
Martin Braun wrote: Another thing worth mentioning (I guess here is a good a place as any other) is the fact that programming and mathematics are still pretty different things, despite how much we programmers would like to think ourselves as some kind of mathematician. Although when it comes

Re: make install DESTDIR

2010-08-20 Thread aj
On Aug 20, 4:39 pm, Thomas Jollans wrote: > On Saturday 21 August 2010, it occurred to aj to exclaim: > > > I am trying to install python with make install DESTDIR=/home/blah > > >                 --prefix=/ > > ... > > > creating /lib/python2.6 > > error: could not create '/lib/python2.6': Permis

Re: Iterative vs. Recursive coding

2010-08-20 Thread Martin Gregorie
On Fri, 20 Aug 2010 16:22:44 -0700, Baba wrote: > For the purposes of learning programming i think it's a must to > understand Recursion so thanks all for your help! > That depends on the language and/or hardware. COBOL wouldn't understand recursion if hit on the head with a recursion brick and e

Re: Python "why" questions

2010-08-20 Thread Gregory Ewing
J.B. Brown wrote: Then users of my class (mainly my research lab coworkers) could specify whichever behavior they wanted. In terms of providing readable code and removing beginning programmer confusion, But having some arrays indexed from 0 and others from 1 can be a recipe for confusion in i

Re: Python "why" questions

2010-08-20 Thread Gregory Ewing
Robert Kern wrote: On 8/16/10 9:29 PM, Roy Smith wrote: In article, Lawrence D'Oliveiro wrote: In message, Roy Smith wrote: 5) real intensity[160.0 : 30.0 : 0.01] How many elements in that array? c) neither of the above. More specifically, 13,001 (if I counted correctly). 13000, a

Re: Python "why" questions

2010-08-20 Thread Gregory Ewing
Martin Gregorie wrote: On Mon, 16 Aug 2010 12:33:51 +1200, Gregory Ewing wrote: Ian Kelly wrote: On Fri, Aug 13, 2010 at 11:53 AM, Martin Gregorie wrote: real sample[-500:750]; Ugh, no. The ability to change the minimum index is evil. Not always; it can have its uses, particul

Re: Python "why" questions

2010-08-20 Thread Gregory Ewing
Lawrence D'Oliveiro wrote: That is not some kind of ordinal numbering of the terms, that is the power of the variable involved. It's both. Convention is to make the power and the index of the coefficent the same, because it would be pointlessly confusing to do anything else. -- Greg -- http:/

Re: Iterative vs. Recursive coding

2010-08-20 Thread Thomas Jollans
On Saturday 21 August 2010, it occurred to Baba to exclaim: > - every time the procedure calls itself the memory gradually fills up > with the copies until the whole thing winds down again > as the "return" statements start being executed. > - the above point means that a recursive approach is ex

Re: Iterative vs. Recursive coding

2010-08-20 Thread Baba
On Aug 19, 11:00 pm, Martin Gregorie wrote: > By way of a hint, here are two versions of the classic example of > recursion: calculating factorials. Recursion can be quite a trick to get > your mind round at first, so compare the two and follow through their > operation step by step... Hi Martin

Re: make install DESTDIR

2010-08-20 Thread Thomas Jollans
On Saturday 21 August 2010, it occurred to aj to exclaim: > I am trying to install python with make install DESTDIR=/home/blah > > --prefix=/ ... > creating /lib/python2.6 > error: could not create '/lib/python2.6': Permission denied > make: *** [sharedinstall] Error 1 Obvious

Re: Iterative vs. Recursive coding

2010-08-20 Thread Baba
Hi Martin Thanks for your post. This basic but fundamental computation is a great example when trying to understand the concept of recursion for the first time. Also thanks to John for the stackoverflow link where i found a very good summarised definition completing some of the posts left here.

make install DESTDIR

2010-08-20 Thread aj
I am trying to install python with make install DESTDIR=/home/blah ./python -E ./setup.py install \ --prefix=/ \ --install-scripts=//bin \ --install-platlib=//lib/python2.6/lib-dynload \ --root=//home/blah running install running buil

Re: Iterative vs. Recursive coding

2010-08-20 Thread Ben Finney
Steven D'Aprano writes: > On Thu, 19 Aug 2010 22:00:16 +, Martin Gregorie wrote: > > > Recursion can be quite a trick to get your mind round at first > > Really? Do people actually find the *concept* of recursion to be > tricky? Evidently so. It's folk wisdom that some adults find recursion

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-20 Thread Hugh Aguilar
On Aug 18, 6:13 pm, Standish P wrote: > > Mostly it had a "snowball's chance" because it was never picked up by > > the CS gurus who, AFAIK, never really took a serious look at it. > > Its quite possible that the criticism is unfair, but dont you think > that in part some responsibility must be bo

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread vsoler
On Aug 20, 7:42 pm, Tim Golden wrote: > On 20/08/2010 5:10 PM, vsoler wrote: > > > > > On Aug 20, 5:10 pm, Tim Golden  wrote: > >> To decode the permission bit-strings to vaguely meaningful > >> names: > > >> > >> import os, sys > >> from winsys import fs > > >> dacl = fs.file (sys.executable).se

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-20 Thread Hugh Aguilar
On Aug 18, 6:23 pm, Standish P wrote: > On Aug 17, 6:38 pm, John Passaniti wrote: > > > You asked if Forth "borrowed" lists from Lisp.  It did not.  In Lisp, > > lists are constructed with pair of pointers called a "cons cell". > > That is the most primitive component that makes up a list.  Forth

Re: How to Customize the New 2.7 ArgumentParser Library Class (module argparse)?

2010-08-20 Thread Peter Otten
Tom Browder wrote: > I have converted from OptionParser to ArgumentParser (new in version > 2.7) to great advantage, and I think it's a great improvement! But > now I want to customize the help formatting just a bit. > > The documentation is sketchy here, but I started by subclassing > ArgumentP

Re: Iterative vs. Recursive coding

2010-08-20 Thread John Bokma
John Nagle writes: > Python does not do tail recursion, so using recursion > where iteration could do the job is generally a bad idea. Scheme, on > the other hand, always does tail recursion where possible. I think you mean tail recursion optimization / elimination. Python does tail recursi

Re: Python "why" questions

2010-08-20 Thread geremy condra
On Fri, Aug 20, 2010 at 12:31 PM, Russ P. wrote: > On Aug 20, 11:19 am, geremy condra wrote: > >> Not sure what you read, but for me (mostly number theory, numerical >> analysis, and abstract algebra) zero-based indexing is quite common. > > My background is in aerospace control engineering. I am

Re: scope of variable

2010-08-20 Thread M B
fre 2010-08-20 klockan 13:19 -0600 skrev Burton Samograd: > M B writes: > > > Hi, > dept=0 > def mud(): > > print dept > > > > > mud() > > 0 > def mud(): > > dept+=1 > > print dept > > You should add a global statement or else python thinks a variable used >

Re: How to convert bytearray into integer?

2010-08-20 Thread Thomas Jollans
On Tuesday 17 August 2010, it occurred to Jacky to exclaim: > On Aug 17, 3:38 am, Thomas Jollans wrote: > > On Monday 16 August 2010, it occurred to Jacky to exclaim: > > > it's hard to image why socket object provides the interface: > > > socket.recv_from(buf[, num_bytes[, flags]]) but forget the

Re: Python "why" questions

2010-08-20 Thread Russ P.
On Aug 20, 11:19 am, geremy condra wrote: > Not sure what you read, but for me (mostly number theory, numerical > analysis, and abstract algebra) zero-based indexing is quite common. My background is in aerospace control engineering. I am certainly not familiar with the literature in pure mathem

How to Customize the New 2.7 ArgumentParser Library Class (module argparse)?

2010-08-20 Thread Tom Browder
I have converted from OptionParser to ArgumentParser (new in version 2.7) to great advantage, and I think it's a great improvement! But now I want to customize the help formatting just a bit. The documentation is sketchy here, but I started by subclassing ArgumentParser and attempted to redefine

Re: scope of variable

2010-08-20 Thread Burton Samograd
M B writes: > Hi, dept=0 def mud(): > print dept > > mud() > 0 def mud(): > dept+=1 > print dept You should add a global statement or else python thinks a variable used is a local: >>> def mud(): global dept dept+=1 print dept -

Re: urllib "quote" problem

2010-08-20 Thread MRAB
John Nagle wrote: On 8/20/2010 8:41 AM, Aahz wrote: In article<4c5eef7f$0$1609$742ec...@news.sonic.net>, John Nagle wrote: This looks like code that will do the wrong thing in Python 2.6 for characters in the range 128-255. Those are illegal in type "str", but this code is constructing

Re: [ANN]VTD-XML 2.9

2010-08-20 Thread John Krukoff
On Thu, 2010-08-19 at 17:40 -0700, dontcare wrote: > VTD-XML 2.9, the next generation XML Processing API for SOA and Cloud > computing, has been released. Please visit > https://sourceforge.net/projects/vtd-xml/files/ > to download the latest version. > > * Strict Conformance > # VTD-XML now f

Re: urllib "quote" problem

2010-08-20 Thread Robert Kern
On 8/20/10 1:50 PM, John Nagle wrote: On 8/20/2010 8:41 AM, Aahz wrote: In article<4c5eef7f$0$1609$742ec...@news.sonic.net>, John Nagle wrote: This looks like code that will do the wrong thing in Python 2.6 for characters in the range 128-255. Those are illegal in type "str", but this code is

Re: Looking for an appropriate encoding standard that supports all languages

2010-08-20 Thread Thomas Jollans
On Thursday 19 August 2010, it occurred to ata.jaf to exclaim: > On Aug 17, 11:55 pm, Thomas Jollans wrote: > > On Tuesday 17 August 2010, it occurred to ata.jaf to exclaim: > > > I am developing a little program in Mac with wxPython. > > > But I have problems with the characters that are not in A

Re: Looking for an appropriate encoding standard that supports all languages

2010-08-20 Thread John Nagle
On 8/20/2010 9:07 AM, Rami Chowdhury wrote: On Fri, Aug 20, 2010 at 21:02, ata.jaf wrote: On Aug 19, 11:48 am, Steven D'Aprano wrote: On Thu, 19 Aug 2010 01:29:51 -0700, ata.jaf wrote: On Aug 17, 11:55 pm, Thomas Jollans wrote: Yes I have a source code encoding line. Here it is: # -*- cod

Re: urllib "quote" problem

2010-08-20 Thread John Nagle
On 8/20/2010 8:41 AM, Aahz wrote: In article<4c5eef7f$0$1609$742ec...@news.sonic.net>, John Nagle wrote: This looks like code that will do the wrong thing in Python 2.6 for characters in the range 128-255. Those are illegal in type "str", but this code is constructing such values with "c

Re: A question to experienced Pythoneers

2010-08-20 Thread Martin Gregorie
On Fri, 20 Aug 2010 17:16:14 +0200, Bruno Desthuilliers wrote: > Rony a écrit : >> It looks like I forgot to specify that the product is a totaly new >> product build from scratch, not an upgrade from an existing product. > > > Still the advice to first find out what went wrong with the previous

Re: scope of variable

2010-08-20 Thread Rony
On Aug 20, 8:25 pm, Chris Rebert wrote: > On Fri, Aug 20, 2010 at 11:09 AM, M B wrote: > > Hi, > > I try to learn python. > > I don't understand this: > > dept=0 > > def mud(): > >        dept+=1 > >        print dept > > mud() > > Traceback (most recent call last): > >  File "",

Re: scope of variable

2010-08-20 Thread Chris Rebert
On Fri, Aug 20, 2010 at 11:09 AM, M B wrote: > Hi, > I try to learn python. > I don't understand this: dept=0 def mud(): >        dept+=1 >        print dept > mud() > Traceback (most recent call last): >  File "", line 1, in >    mud() >  File "", line 2, in mud >    dept+=1 > U

Re: Python "why" questions

2010-08-20 Thread geremy condra
On Fri, Aug 20, 2010 at 11:01 AM, Russ P. wrote: > On Aug 20, 1:23 am, Martin Braun wrote: > >> I find this thread extremely interesting, but what surprised me that >> everyone seems to agree that mathematics is 1-based, but we Pythoneers >> should stick to zero-based. I disagree. To make sure I'

scope of variable

2010-08-20 Thread M B
Hi, I try to learn python. I don't understand this: (running in idle) >>> dept=0 >>> def mud(): print dept >>> mud() 0 >>> def mud(): dept+=1 print dept >>> mud() Traceback (most recent call last): File "", line 1, in mud() File "", line 2, in

Re: Python "why" questions

2010-08-20 Thread Russ P.
On Aug 20, 1:23 am, Martin Braun wrote: > I find this thread extremely interesting, but what surprised me that > everyone seems to agree that mathematics is 1-based, but we Pythoneers > should stick to zero-based. I disagree. To make sure I'm not going > crazy, I took the top five books lying on

Re: Problem with tarfile module to open *.tar.gz files - unreliable ?

2010-08-20 Thread Peter Otten
m_ahlenius wrote: > I am using Python 2.6.5. > > Unfortunately I don't have other versions installed so its hard to > test with a different version. > > As for the log compression, its a bit hard to test. Right now I may > process 100+ of these logs per night, and will get maybe 5 which are > r

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread Thomas Jollans
On Friday 20 August 2010, it occurred to Nobody to exclaim: > Unix lacks the "Append Data" permission for files, and the "Create Files", > "Create Folders" and "Delete Subfolders and Files" correspond to having > write permission on a directory. How does append differ from write? If you have appen

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread Tim Golden
On 20/08/2010 5:10 PM, vsoler wrote: On Aug 20, 5:10 pm, Tim Golden wrote: To decode the permission bit-strings to vaguely meaningful names: import os, sys from winsys import fs dacl = fs.file (sys.executable).security ().dacl for permission in dacl: print (d.trustee, " (Inherited )" if

Re: Iterative vs. Recursive coding

2010-08-20 Thread Neil Cerutti
On 2010-08-20, John Nagle wrote: > Python does not do tail recursion, so using recursion where > iteration could do the job is generally a bad idea. Scheme, on > the other hand, always does tail recursion where possible. A tail-recursive function is usually easy to convert to a loop-style iterat

Re: Problem with tarfile module to open *.tar.gz files - unreliable ?

2010-08-20 Thread m_ahlenius
On Aug 20, 9:25 am, Peter Otten <__pete...@web.de> wrote: > m_ahlenius wrote: > > On Aug 20, 6:57 am, m_ahlenius wrote: > >> On Aug 20, 5:34 am, Dave Angel wrote: > > >> > m_ahlenius wrote: > >> > > Hi, > > >> > > I am relatively new to doing serious work in python.  I am using it > >> > > to acc

Re: Iterative vs. Recursive coding

2010-08-20 Thread John Nagle
On 8/20/2010 12:47 AM, News123 wrote: On 08/20/2010 02:26 AM, Steven D'Aprano wrote: On Thu, 19 Aug 2010 22:00:16 +, Martin Gregorie wrote: Recursion can be quite a trick to get your mind round at first Really? Do people actually find the *concept* of recursion to be tricky? Is this a s

Re: Problem with tarfile module to open *.tar.gz files - unreliable ?

2010-08-20 Thread m_ahlenius
On Aug 20, 9:10 am, Dave Angel wrote: > m_ahlenius wrote: > > On Aug 20, 6:57 am, m_ahlenius wrote: > > >> On Aug 20, 5:34 am, Dave Angel wrote: > > >>> m_ahlenius wrote: > > Hi, > > I am relatively new to doing serious work in python.  I am using it to > access a large number of

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread vsoler
On Aug 20, 5:10 pm, Tim Golden wrote: > On 20/08/2010 15:49, vsoler wrote: > > > > > On Aug 20, 4:26 pm, vsoler  wrote: > >> On Aug 20, 9:36 am, Tim Golden  wrote: > > I currently do not have subversion access in my PC. I could try to > install a free copy of it. But it you could ptovide

Re: Looking for an appropriate encoding standard that supports all languages

2010-08-20 Thread Rami Chowdhury
On Fri, Aug 20, 2010 at 21:02, ata.jaf wrote: > On Aug 19, 11:48 am, Steven D'Aprano t...@cybersource.com.au> wrote: >> On Thu, 19 Aug 2010 01:29:51 -0700, ata.jaf wrote: >> > On Aug 17, 11:55 pm, Thomas Jollans wrote: >> >> On Tuesday 17 August 2010, it occurred to ata.jaf to exclaim: >> >> >>

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread vsoler
On Aug 20, 5:10 pm, Tim Golden wrote: > On 20/08/2010 15:49, vsoler wrote: > > > > > On Aug 20, 4:26 pm, vsoler  wrote: > >> On Aug 20, 9:36 am, Tim Golden  wrote: > > I currently do not have subversion access in my PC. I could try to > install a free copy of it. But it you could ptovide

Re: A question to experienced Pythoneers

2010-08-20 Thread Aahz
In article <8d1b76b7-1ba3-49c5-97cf-dc3837050...@y11g2000yqm.googlegroups.com>, Rony wrote: > >The manager of the development has been fired, main reason (what they >told me) is that they have big big troubles in keeping deadlines ! For >there last product, for which they estimated 3 man years of

Re: requirements in writing an email/rss/usenet client?

2010-08-20 Thread Aahz
In article , George Oliver wrote: > >I'd like to know what to consider when writing an email/rss/usenet >client. Apologies for such a broad question, but I've never attempted >a project of this scope and I'm currently feeling out the >requirements. About the only advice I can give you to such a

Re: Iterative vs. Recursive coding

2010-08-20 Thread Bruno Desthuilliers
Michel Claveau - MVP a écrit : Salut ! C'est cela, la solitude du programmeur génial... @-salutations Moi aussi je t'aime, Michel !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib "quote" problem

2010-08-20 Thread Aahz
In article <4c5eef7f$0$1609$742ec...@news.sonic.net>, John Nagle wrote: > > This looks like code that will do the wrong thing in >Python 2.6 for characters in the range 128-255. Those are >illegal in type "str", but this code is constructing such >values with "chr". WDYM "illegal"? -- Aahz

Re: Iterative vs. Recursive coding

2010-08-20 Thread Michel Claveau - MVP
Salut ! C'est cela, la solitude du programmeur génial... @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterative vs. Recursive coding

2010-08-20 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Thu, 19 Aug 2010 22:00:16 +, Martin Gregorie wrote: Recursion can be quite a trick to get your mind round at first Really? Do people actually find the *concept* of recursion to be tricky? I onced worked in a shop (Win32 desktop / accouting applications main

Re: A question to experienced Pythoneers

2010-08-20 Thread Bruno Desthuilliers
Rony a écrit : It looks like I forgot to specify that the product is a totaly new product build from scratch, not an upgrade from an existing product. Still the advice to first find out what went wrong with the previous project is a very sensible one. Technical problems do exist, but from ex

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread Tim Golden
On 20/08/2010 15:49, vsoler wrote: On Aug 20, 4:26 pm, vsoler wrote: On Aug 20, 9:36 am, Tim Golden wrote: I currently do not have subversion access in my PC. I could try to install a free copy of it. But it you could ptovide an installer, it certainly would do things easier. Please let me k

Re: Looking for an appropriate encoding standard that supports all languages

2010-08-20 Thread ata.jaf
On Aug 19, 11:48 am, Steven D'Aprano wrote: > On Thu, 19 Aug 2010 01:29:51 -0700, ata.jaf wrote: > > On Aug 17, 11:55 pm, Thomas Jollans wrote: > >> On Tuesday 17 August 2010, it occurred to ata.jaf to exclaim: > > >> > I am developing a little program in Mac with wxPython. But I have > >> > prob

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread vsoler
On Aug 20, 4:26 pm, vsoler wrote: > On Aug 20, 9:36 am, Tim Golden wrote: > > > > I currently do not have subversion access in my PC. I could try to > > > install a free copy of it. But it you could ptovide an installer, it > > > certainly would do things easier. Please let me know if it is > > >

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread vsoler
On Aug 20, 9:36 am, Tim Golden wrote: > > I currently do not have subversion access in my PC. I could try to > > install a free copy of it. But it you could ptovide an installer, it > > certainly would do things easier. Please let me know if it is > > possible. > > Vicente, can you just confirm th

Re: A question to experienced Pythoneers

2010-08-20 Thread Rony
It looks like I forgot to specify that the product is a totaly new product build from scratch, not an upgrade from an existing product. Interesting answers ! Rony -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with tarfile module to open *.tar.gz files - unreliable ?

2010-08-20 Thread Peter Otten
m_ahlenius wrote: > On Aug 20, 6:57 am, m_ahlenius wrote: >> On Aug 20, 5:34 am, Dave Angel wrote: >> >> >> >> >> >> > m_ahlenius wrote: >> > > Hi, >> >> > > I am relatively new to doing serious work in python. I am using it >> > > to access a large number of log files. Some of the logs get >>

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread vsoler
On Aug 20, 9:36 am, Tim Golden wrote: > > I currently do not have subversion access in my PC. I could try to > > install a free copy of it. But it you could ptovide an installer, it > > certainly would do things easier. Please let me know if it is > > possible. > > Vicente, can you just confirm th

Re: A question to experienced Pythoneers

2010-08-20 Thread Stefan Schwarzer
Hi Rony, On 2010-08-20 10:16, Rony wrote: > Here's the story : > I've been hired by a company as a consultant to reorganise there > development department. > The actual situation is : > The manager of the development has been fired, main reason (what they > told me) is that they have big big troub

Re: Problem with tarfile module to open *.tar.gz files - unreliable ?

2010-08-20 Thread Dave Angel
m_ahlenius wrote: On Aug 20, 6:57 am, m_ahlenius wrote: On Aug 20, 5:34 am, Dave Angel wrote: m_ahlenius wrote: Hi, I am relatively new to doing serious work in python. I am using it to access a large number of log files. Some of the logs get corrupted and I n

Re: 79 chars or more?

2010-08-20 Thread Neil Cerutti
On 2010-08-20, Bruno Desthuilliers wrote: > make this : > > self.expiration_date = translate_date( > find(response, 'MPNExpirationDate').text, > '%Y-%m-%d', > '%m%d%Y' > ) > > I just HATE closing parens on the same line w

Re: 79 chars or more?

2010-08-20 Thread Bruno Desthuilliers
Stefan Schwarzer a écrit : Hi Neil, On 2010-08-17 14:42, Neil Cerutti wrote: (snip) Looking through my code, the split-up lines almost always include string literals or elimination of meaningless temporary variables, e.g.: self.expiration_date = translate_date(find(response,

Re: A question to experienced Pythoneers

2010-08-20 Thread Stefan Schwarzer
Hi Lawrence, On 2010-08-20 13:11, Lawrence D'Oliveiro wrote: > In message > <8d1b76b7-1ba3-49c5-97cf-dc3837050...@y11g2000yqm.googlegroups.com>, Rony > wrote: > >> The manager of the development has been fired, main reason (what they >> told me) is that they have big big troubles in keeping deadli

Get authentication error while using 'smtplib'

2010-08-20 Thread Mahmood Naderan
I have this script to send an email via SMTP: import smtplib smtpserver = 'smtp.server.com' AUTHREQUIRED = 1# if you need to use SMTP AUTH set to 1 smtpuser = "username"# for SMTP AUTH, set SMTP username here smtppass = "password"# for SMTP AUTH, set SMTP password here RECIPIENTS ='recipi...@server

Re: Problem with tarfile module to open *.tar.gz files - unreliable ?

2010-08-20 Thread m_ahlenius
On Aug 20, 6:57 am, m_ahlenius wrote: > On Aug 20, 5:34 am, Dave Angel wrote: > > > > > > > m_ahlenius wrote: > > > Hi, > > > > I am relatively new to doing serious work in python.  I am using it to > > > access a large number of log files.  Some of the logs get corrupted > > > and I need to dete

Re: 79 chars or more?

2010-08-20 Thread Neil Cerutti
On 2010-08-20, Roy Smith wrote: > In article <4c6dfb31$0$1$c3e8...@news.astraweb.com>, > Steven D'Aprano wrote: > >> Of course source code is written in a monospaced typeface, which is a >> little wider and consequently fewer characters per page. > > There was a fling a while ago with types

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-20 Thread Malcolm McLean
On Aug 19, 2:14 pm, spinoza wrote: > All the rest [how to implement heaps] is > detail for the little techies to normally, get wrong. > That's a fundamental feature of structured programming. If we maintain the interface malloc(), realloc(), and free(), then we could have a fairly simple or a

Re: 79 chars or more?

2010-08-20 Thread Roy Smith
In article <4c6dfb31$0$1$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: > Of course source code is written in a monospaced typeface, which is a > little wider and consequently fewer characters per page. There was a fling a while ago with typesetting code in proportional spaced type.

Re: A question to experienced Pythoneers

2010-08-20 Thread Rami Chowdhury
On Fri, Aug 20, 2010 at 15:25, geremy condra wrote: > On Fri, Aug 20, 2010 at 1:16 AM, Rony wrote: >> Here's the story : >> I've been hired by a company as a consultant to reorganise there >> development department. [snip] >> One of my plans is to introduce Python as development tool. >> They mos

Re: Problem with tarfile module to open *.tar.gz files - unreliable ?

2010-08-20 Thread m_ahlenius
On Aug 20, 5:34 am, Dave Angel wrote: > m_ahlenius wrote: > > Hi, > > > I am relatively new to doing serious work in python.  I am using it to > > access a large number of log files.  Some of the logs get corrupted > > and I need to detect that when processing them.  This code seems to > > work fo

Re: OpenCV_Problem

2010-08-20 Thread Rami Chowdhury
On Thu, Aug 19, 2010 at 13:47, arihant nahata wrote: > I m new to python and openCV. i installed openCV and python and copied the > necessary folder. and even appended the sys.path. but then too the same error. > > from opencv import cv > > File "C:\Python26\lib\site-packages\opencv\__init__.py",

Re: A question to experienced Pythoneers

2010-08-20 Thread Lawrence D'Oliveiro
In message <8d1b76b7-1ba3-49c5-97cf-dc3837050...@y11g2000yqm.googlegroups.com>, Rony wrote: > The manager of the development has been fired, main reason (what they > told me) is that they have big big troubles in keeping deadlines ! For > there last product, for which they estimated 3 man years o

Re: Problem with tarfile module to open *.tar.gz files - unreliable ?

2010-08-20 Thread Dave Angel
m_ahlenius wrote: Hi, I am relatively new to doing serious work in python. I am using it to access a large number of log files. Some of the logs get corrupted and I need to detect that when processing them. This code seems to work for quite a few of the logs (all same structure) It also corr

Re: A question to experienced Pythoneers

2010-08-20 Thread Rony
On Aug 20, 11:25 am, geremy condra wrote: > 1) Don't take this the wrong way, but get in the habit of using proper > grammar and spelling. Especially as a consultant. It will make the job > of convincing people to take you seriously that much easier. I don't take it the wrong way but have an ans

Re: A question to experienced Pythoneers

2010-08-20 Thread geremy condra
On Fri, Aug 20, 2010 at 1:16 AM, Rony wrote: > Here's the story : > I've been hired by a company as a consultant to reorganise there > development department. > The actual situation is : > The manager of the development has been fired, main reason (what they > told me) is that they have big big tr

Re: Python "why" questions

2010-08-20 Thread Martin Braun
On Thu, Aug 19, 2010 at 07:13:50PM +, Steven D'Aprano wrote: > Mathematics is an ancient art that values tradition and convention. It > doesn't matter how hard it was to come up with a proof, or how difficult > to verify it. Mathematicians value logical correctness and some > undefinable sen

Re: Iterative vs. Recursive coding

2010-08-20 Thread geremy condra
On Fri, Aug 20, 2010 at 12:47 AM, News123 wrote: > On 08/20/2010 02:26 AM, Steven D'Aprano wrote: >> On Thu, 19 Aug 2010 22:00:16 +, Martin Gregorie wrote: >> >>> Recursion can be quite a trick to get your mind round at first >> >> Really? Do people actually find the *concept* of recursion to

Re: Iterative vs. Recursive coding

2010-08-20 Thread Navkirat Singh
On 20-Aug-2010, at 1:17 PM, News123 wrote: > On 08/20/2010 02:26 AM, Steven D'Aprano wrote: >> On Thu, 19 Aug 2010 22:00:16 +, Martin Gregorie wrote: >> >>> Recursion can be quite a trick to get your mind round at first >> >> Really? Do people actually find the *concept* of recursion to be

A question to experienced Pythoneers

2010-08-20 Thread Rony
Here's the story : I've been hired by a company as a consultant to reorganise there development department. The actual situation is : The manager of the development has been fired, main reason (what they told me) is that they have big big troubles in keeping deadlines ! For there last product, for

Re: Iterative vs. Recursive coding

2010-08-20 Thread News123
On 08/20/2010 02:26 AM, Steven D'Aprano wrote: > On Thu, 19 Aug 2010 22:00:16 +, Martin Gregorie wrote: > >> Recursion can be quite a trick to get your mind round at first > > Really? Do people actually find the *concept* of recursion to be tricky? Is this a sincere surprise or are you just b

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread Tim Golden
I currently do not have subversion access in my PC. I could try to install a free copy of it. But it you could ptovide an installer, it certainly would do things easier. Please let me know if it is possible. Vicente, can you just confirm that you received the installer I sent offlist? I'll try t

Re: Assert statements in python 3.1

2010-08-20 Thread Mark Dickinson
On Aug 20, 6:13 am, genxtech wrote: > This is more of a curiosity question then anything else...  I was just > wondering why in version 3 of python assertions weren't converted to > use parenthesis, since print was. > > I am just asking because it seems the following line of code would > seem more

Re: Python "why" questions

2010-08-20 Thread Kai Borgolte
Sorry about my previous posting with wrong references, this one should be better. Steven D'Aprano wrote: >A simple example: Using zero-based indexing, suppose you want to indent >the string "spam" so it starts at column 4. How many spaces to you >prepend? No, you won't want to indent a string

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-20 Thread Standish P
On Aug 19, 8:25 am, c...@tiac.net (Richard Harter) wrote: > On Wed, 18 Aug 2010 01:39:09 -0700 (PDT), Nick Keighley > > wrote: > >On 17 Aug, 18:34, Standish P wrote: > >> How are these heaps being implemented ? Is there some illustrative > >> code or a book showing how to implement these heaps in

Re: Python "why" questions

2010-08-20 Thread Kai Borgolte
Russ P. wrote: >> A simple example: Using zero-based indexing, suppose you want to indent >> the string "spam" so it starts at column 4. How many spaces to you >> prepend? No, you won't want to indent a string so it starts at column 4. You simply want to indent the string by four spaces. Like in

  1   2   >