Re: Comparing lists

2005-10-16 Thread James Dennett
Steven D'Aprano wrote: > On Sat, 15 Oct 2005 18:17:36 +0200, Christian Stapfer wrote: > > I'd prefer a (however) rough characterization of computational complexity in terms of Big-Oh (or Big-whatever) *anytime* to marketing-type characterizations like this one... >>> >>>Oh how nai

Re: Euclid's Algorithm in Python?

2005-08-14 Thread James Dennett
Antoon Pardon wrote: > On 2005-08-08, Bengt Richter <[EMAIL PROTECTED]> wrote: > >>On 7 Aug 2005 17:31:02 -0700, "Jordan Rastrick" <[EMAIL PROTECTED]> wrote: >> >> >>>Good point. I suppose I'd only ever seen it implemented with the if >>>test, but you're right, the plain while loop should work fi

Re: how to write a line in a text file

2005-08-10 Thread James Dennett
Calvin Spealman wrote: > On 7/31/05, James Dennett <[EMAIL PROTECTED]> wrote: > >>Peter Hansen wrote: >> >> >>>Steven D'Aprano wrote: >>> >>>Given that ZODB and PySQLite are simply Python extension modules, which >>>get bu

Re: How to determine that if a folder is empty?

2005-08-08 Thread James Dennett
Reinhold Birkenfeld wrote: > could ildg wrote: > >>I want to check if a folder named "foldername" is empty. >>I use os.listdir(foldername)==[] to do this, >>but it will be very slow if the folder has a lot of sub-files. >>Is there any efficient ways to do this? > > > try: > os.rmdir(path) >

Re: how to write a line in a text file

2005-07-31 Thread James Dennett
Peter Hansen wrote: > Steven D'Aprano wrote: > >> On Wed, 27 Jul 2005 04:26:31 +, Andrew Dalke wrote: >> >>> This isn't 1970. Why does your app code work directly with >>> files? Use a in-process database library (ZODB, SQLLite, >>> BerkeleyDB, etc.) to maintain your system state and let th

Re: How can I import a py script by its absolute path name?

2005-07-15 Thread James Dennett
J.Bijsterbosch wrote: > Hello Edward, > > "Edvard Majakari" <[EMAIL PROTECTED]> schreef in bericht > news:[EMAIL PROTECTED] > >>Thorsten Kampe <[EMAIL PROTECTED]> writes: >> >> >>>"sys.path.append('c:\\xxx\\yyy')" or "sys.path.append('c:/xxx/yyy')" >> >>Well, of course. As I said, it was unteste

Re: inheritance

2005-07-10 Thread James Dennett
J wrote: > just to follow up. I managed to get it working by having a closer look > at the xxmodules. However, the example does the following > > typedef struct > { > PyStructBaseClass mBase; > int mValue; > } PyStructDerivedClass; > > Does anythi

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread James Dennett
Pete Barrett wrote: > On 10 Jul 2005 02:57:04 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote: > > >>Similarly, in computer languages, expressiveness is significant with >>respect to semantics, not syntactical variation. >> > > It may just be me, but I tend to think of a computer language as a > too

Re: math.nroot [was Re: A brief question.]

2005-07-04 Thread James Dennett
Steven D'Aprano wrote: > James Dennett wrote: > >> > Yes: 5^2 + -2^2 is 29, however you write it. >> >> *If* you take -2 as a number, but not if you take the number >> as 2 and the unary minus as an operator with lower precedence >> than exponentiati

Re: math.nroot [was Re: A brief question.]

2005-07-03 Thread James Dennett
Tom Anderson wrote: > On Sun, 3 Jul 2005, George Sakkis wrote: > >> "Tom Anderson" <[EMAIL PROTECTED]> wrote: >> > And finally, does Guido know something about arithmetic that i > don't, or > is this expression: > > -1.0 ** 0.5 > > Evaluated wrongly? No

[offtopic] Re: Set of Dictionary

2005-06-26 Thread James Dennett
Steven D'Aprano wrote: > On Thu, 16 Jun 2005 21:21:50 +0300, Konstantin Veretennicov wrote: > > >>On 6/16/05, Vibha Tripathi <[EMAIL PROTECTED]> wrote: >> >>>I need sets as sets in mathematics: >> >>That's tough. First of all, mathematical sets can be infinite. It's >>just too much memory :) >>S