Re: Seeking IDE

2005-07-02 Thread [EMAIL PROTECTED]
If you are looking for a small and simple text editor that moonlights as an IDE, my suggestion would be SciTE(http://scintilla.org/SciTE.html). It has reasonable syntax highlighting and can run Python scripts if you press F5. -- http://mail.python.org/mailman/listinfo/python-list

Another newbie question from Nathan.

2005-07-02 Thread Nathan Pinno
Hi all. How do I make the computer generate 4 random numbers for the guess? I want to know because I'm writing a computer program in Python like the game MasterMind. Thanks. -- Nathan Pinno http://www.npinnowebsite.ca/ --

Re: Another newbie question from Nathan.

2005-07-02 Thread Brian van den Broek
Nathan Pinno said unto the world upon 02/07/2005 02:25: Hi all. How do I make the computer generate 4 random numbers for the guess? I want to know because I'm writing a computer program in Python like the game MasterMind. Thanks. -- Nathan Pinno

wxPython: Terminal Output - Scrollable Panel?

2005-07-02 Thread flamesrock
First, I'm very new to gui programming, so please go lightly on me :) Ok, so far I've settled on wxPython, and what I'd like to do as a first leap is *convert* a text program into a gui program. It would have a few buttons as function controls and one main scrollable panel that acts like a

Re: pexpect question....

2005-07-02 Thread Ganesan Rajagopal
[EMAIL PROTECTED] == [EMAIL PROTECTED] com [EMAIL PROTECTED] writes: Hi, I am using pexpect to spawn an interactive program and wait for particular string in its output. It works fine but once I get this required information, I really don't care about the child process anymore. I would

Re: It seems that ZipFile().write() can only write files, how can empty directories be put into it?

2005-07-02 Thread could ildg
Thank you. On 7/1/05, Jeff Epler [EMAIL PROTECTED] wrote: This has been discussed before. One thread I found was http://mail.python.org/pipermail/python-list/2003-June/170526.html The advice in that message might work for you. Jeff --

Re: shelve in a ZipFile?

2005-07-02 Thread Andreas Kostyrka
Am Freitag, den 01.07.2005, 10:53 -0700 schrieb Scott David Daniels: Terry Hancock wrote: I only just recently had a look at the shelve module That would be handy if, for example, I wanted to couple (and compress into the bargain) by putting my two shelf files into a single zip

Re: No Subject

2005-07-02 Thread Andreas Kostyrka
Am Freitag, den 01.07.2005, 18:55 +0200 schrieb Harry George: Tom Anderson [EMAIL PROTECTED] writes: On Fri, 1 Jul 2005, Adriaan Renting wrote: I'm not a very experienced Python programmer yet, so I might be mistaken, but there are a few things that would make me prefer C++ over

What are the other options against Zope?

2005-07-02 Thread godwin
Hi all, I wanna thank Martin for helping out with my ignorance concerning execution of stored procedure with python. Now i have decided to write a web app that googles into my companies proprietary database. I need to know whether zope is good for that job. But even the introduction to zope

Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-02 Thread Ralf W. Grosse-Kunstleve
** This posting is also available in HTML format: http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html ** Hi fellow Python coders,

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-02 Thread John Roth
Robert Kern [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] map and filter are being removed *because of* list comprehensions. Did you even read Guido's articles about this issue? Your understanding of why these changes are planned is incorrect; consequently your projection based

Re: Accepted Summer of Code proposals

2005-07-02 Thread Reinhold Birkenfeld
A.M. Kuchling wrote: For anyone who's interested: the Python wiki now contains a list of the PSF-mentored proposals that were accepted for Google's Summer of Code: http://wiki.python.org/moin/SummerOfCode Is it right that two Wax proposals were accepted? Reinhold --

Re: Python, mysql, floating point values question

2005-07-02 Thread qwweeeit
Hi Christopher, if you have to make calculations or comparing operations, the only safe method is to save and use only integer values. Of course there must be a preventive agreement on the precision you want to have (2, 3 4 ... decimals). The sw part is straigthforward: - to save in the database

Re: Which kid's beginners programming - Python or Forth?

2005-07-02 Thread TZOTZIOY
On Tue, 28 Jun 2005 12:58:21 -0700, rumours say that Dave Benjamin [EMAIL PROTECTED] might have written: BORT wrote: I am toying with the idea of teaching my ten year old a little about programming. I started my search with something like best FREE programming language for kids. After MUCH

Re: Boss wants me to program

2005-07-02 Thread TZOTZIOY
On Wed, 29 Jun 2005 07:11:43 -0500, rumours say that phil [EMAIL PROTECTED] might have written: I wonder what percentage of the tools you refer to are Eclipse and not Java per se. ?? I don't know. The really big bucks of IBM sent Eclipse through the roof. The project name is pretty offensive

Re: Accepted Summer of Code proposals

2005-07-02 Thread Peter Hansen
Reinhold Birkenfeld wrote: A.M. Kuchling wrote: For anyone who's interested: the Python wiki now contains a list of the PSF-mentored proposals that were accepted for Google's Summer of Code: http://wiki.python.org/moin/SummerOfCode Is it right that two Wax proposals were accepted?

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-02 Thread Gregory K. Johnson
On Sat, Jul 02, 2005 at 03:04:09AM -0700, Ralf W. Grosse-Kunstleve wrote: [...] Minimal proposal My minimal proposal is to add an enhanced version of ``adopt_init_args()`` as a standard Python built-in function (actual name secondary!):: class grouping: def

Re: What are the other options against Zope?

2005-07-02 Thread Peter Hansen
godwin wrote: I wanna thank Martin for helping out with my ignorance concerning execution of stored procedure with python. Now i have decided to write a web app that googles into my companies proprietary database. Just checking... do you really mean googles, or is that in your mind a

Re: When someone from Britain speaks, Americans hear a British accent...

2005-07-02 Thread Stephen Kellett
In message [EMAIL PROTECTED], [EMAIL PROTECTED] writes T can be silent in England too .. frui' cricke' Both of those words (fruit and cricket) have the letter T sounded. Stephen (Nationality: English). -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html

Re: Bad Math

2005-07-02 Thread Patrick Rutkowski
On 7/2/05, Brian van den Broek [EMAIL PROTECTED] wrote: Patrick Rutkowski said unto the world upon 02/07/2005 00:12: That's... annoying, to say the least. And my number 4/5 was a rational number too; I can understand how when doing 1/3 things can get funky. Really though... 4/5 = 0.8 right

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-02 Thread Roy Smith
Ralf W. Grosse-Kunstleve [EMAIL PROTECTED] wrote: class grouping: def __init__(self, .keep_this, .and_this, but_not_this, .but_this_again): # real code right here I'm really torn about this. On the one hand, my first thought was you shouldn't be writing constructors

Re: MD5 problem

2005-07-02 Thread TZOTZIOY
On Mon, 13 Jun 2005 14:00:33 +0200, rumours say that fargo [EMAIL PROTECTED] might have written: If I use the md5 module with .txt files, it'ok. The Problem comes from the .msg files. I get the same signature for every .msg file I try to hash with the md5 algorithm. I think some character are

Re: Python choice of database

2005-07-02 Thread TZOTZIOY
On 20 Jun 2005 11:43:28 -0700, rumours say that Oren Tirosh [EMAIL PROTECTED] might have written: For very short keys and record (e.g. email addresses) you can use symbolic links instead of files. The advantage is that you have a single system call (readlink) to retrieve the contents of a link.

Re: Python choice of database

2005-07-02 Thread TZOTZIOY
On Tue, 21 Jun 2005 17:00:17 +0300, rumours say that Konstantin Veretennicov [EMAIL PROTECTED] might have written: On 6/21/05, Charles Krug [EMAIL PROTECTED] wrote: Related question: What if I need to create/modify MS-Access or SQL Server dbs? You could use ADO + adodbapi for both.

Re: Python choice of database

2005-07-02 Thread TZOTZIOY
On Mon, 20 Jun 2005 23:42:21 -0800, rumours say that EP [EMAIL PROTECTED] might have written: I tried this for one application under the Windows OS and it worked fine... until my records (text - maybe 50KB average) unexpectedly blossomed into the 10,000-1,000,000 ranges. If I or someone else

Re: Boss wants me to program

2005-07-02 Thread Riccardo Galli
On Tue, 28 Jun 2005 12:57:36 -0700, xeys_00 wrote: The other alternative is to install console mode linux on it and hope that the ncurses library can be used by python. Hi, for curses module and linux, I made a library which give you various widgets (combobox, buttons,checkbox,menubar,...).

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-02 Thread Andrew Koenig
Ralf W. Grosse-Kunstleve [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] class grouping: def __init__(self, .x, .y, .z): # real code right here Emulation using existing syntax:: def __init__(self, x, y, z): self.x = x del x

Re: web programming with mod_python

2005-07-02 Thread Ray Cote
At 7:17 PM -0300 7/1/05, Rodrigo Dominguez wrote: My question is: is there some kind of framework that works with mod_python? You could take a look at Myghty: http://www.myghty.org/ -- Raymond Cote Appropriate Solutions, Inc. PO Box 458 ~ Peterborough, NH 03458-0458 Phone:

Re: Modules for inclusion in standard library?

2005-07-02 Thread Colin J. Williams
Steven Bethard wrote: Fredrik Johansson wrote: On 6/27/05, Reinhold Birkenfeld [EMAIL PROTECTED] wrote: Do you have any other good and valued Python modules that you would think are bug-free, mature (that includes a long release distance) and useful enough to be granted a place in

Re: Re:

2005-07-02 Thread Tom Anderson
On Fri, 1 Jul 2005, Andreas Kostyrka wrote: Am Freitag, den 01.07.2005, 08:25 -0700 schrieb George Sakkis: Again, how? Is there a way to force that an external user of my lib can not use my internal data/methods/classes, unless he uses odd compiler hacks? I never understood how mainstream

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-02 Thread Tom Anderson
On Fri, 1 Jul 2005, Ivan Van Laningham wrote: Personally, I find that Lisp its derivatives put your head in a very weird place. Even weirder than PostScript/Forth/RPN, when you come right down to it. +1 QOTW! tom -- REMOVE AND DESTROY --

Re: map vs. list-comprehension

2005-07-02 Thread Tom Anderson
On Fri, 1 Jul 2005, Sion Arrowsmith wrote: Tom Anderson [EMAIL PROTECTED] wrote: On Thu, 30 Jun 2005, Roy Smith wrote: Even some of the relatively recent library enhancements have been kind of complicated. The logging module, for example, seems way over the top. Exactly the same thing

Re: Modules for inclusion in standard library?

2005-07-02 Thread Tom Anderson
On Fri, 1 Jul 2005, Scott David Daniels wrote: Daniel Dittmar wrote: Rocco Moretti wrote: Except that (please correct me if I'm wrong) there is somewhat of a policy for not including interface code for third party programs which are not part of the operating system. (I.e. the modules in

Re: Modules for inclusion in standard library?

2005-07-02 Thread Colin J. Williams
Gregory Piñero wrote: While that policy does make sense, I think a database program falls somewhere in between an OS and an everyday third party program. For web developers, the database might as well be the OS. I use the database to store everything in my web app. That way I can just worry

Re: Modules for inclusion in standard library?

2005-07-02 Thread Colin J. Williams
Rocco Moretti wrote: Paul Rubin wrote: Rocco Moretti [EMAIL PROTECTED] writes: Except that (please correct me if I'm wrong) there is somewhat of a policy for not including interface code for third party programs which are not part of the operating system. (I.e. the modules in the standard

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-02 Thread Robert Kern
John Roth wrote: Robert Kern [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] map and filter are being removed *because of* list comprehensions. Did you even read Guido's articles about this issue? Your understanding of why these changes are planned is incorrect; consequently your

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-02 Thread Roy Smith
Andrew Koenig [EMAIL PROTECTED] wrote: In Python, unlike many other languages, the names of formal parameters are part of a function's interface. For example: def f(x, y): return x-y Now f(3, 4) is -1 and f(y=3,x=4) is 1. The names of instance variables are generally not

Re: What are the other options against Zope?

2005-07-02 Thread Florian Lindner
Peter Hansen wrote: godwin wrote: I wanna thank Martin for helping out with my ignorance concerning execution of stored procedure with python. Now i have decided to write a web app that googles into my companies proprietary database. Just checking... do you really mean googles, or is

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Jamey Cribbs
Tom Anderson wrote: So, if you're a pythonista who loves map and lambda, and disagrees with Guido, what's your background? Functional or not? I have no functional language background. Until recently, I had no use for programming expression to be evaluated later or deferred expressions or

Re: Re:

2005-07-02 Thread Andreas Kostyrka
Am Samstag, den 02.07.2005, 15:11 +0100 schrieb Tom Anderson: On Fri, 1 Jul 2005, Andreas Kostyrka wrote: Am Freitag, den 01.07.2005, 08:25 -0700 schrieb George Sakkis: Again, how? Is there a way to force that an external user of my lib can not use my internal data/methods/classes,

Re: What are the other options against Zope?

2005-07-02 Thread phil
Peter Hansen wrote: godwin wrote: I wanna thank Martin for helping out with my ignorance concerning execution of stored procedure with python. Now i have decided to write a web app that googles into my companies proprietary database. Just checking... do you really mean googles, or

Re: Which kid's beginners programming - Python or Forth?

2005-07-02 Thread André
Scanning quickly through the various response, I noticed that at least one person suggested rur-ple (rur-ple.sf.net), hence Python. I would second that ;-) ... but then, I am biased as the author of rur-ple! rur-ple is intended to be a complete learning environment for learning programming and

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Mike Meyer
Jamey Cribbs [EMAIL PROTECTED] writes: Code blocks allow you to wrap up any Ruby code and pass it to a method and have it executed within that method. It is more powerful than lambda, because you can have multiple statements in the code block and you can do assignment within the code block.

Re: Splitting string into dictionary

2005-07-02 Thread Christopher Subich
Robert Kern wrote: David Pratt wrote: I have string text with language text records that looks like this: 'en' | 'the brown cow' | 'fr' | 'la vache brun' translations = [x.strip( ') for x in line.split('|')] d = dict(zip(translations[::2], translations[1::2])) One caevat is that this

email link and foreign accent

2005-07-02 Thread Vittorio
Hi, I have one problem ( I am a python beginner) in a cgi: printa href=mailto:%s; %(campovalore.encode('iso-8859-1')) print campovalore.encode('iso-8859-1') print /a campovalore is an email address with special (italian) characters. From IE6 everything is fine and the link launches my

What's wrong with this code?

2005-07-02 Thread Nathan Pinno
Hi all, What's wrong with the following code? It says there is name error, that random is not defined. How do I fix it? # Plays the guessing game higher or lower. # Originally written by Josh Cogliati, improved first by Quique, then by Nathan Pinno. print Higher or Lower print

Re: What's wrong with this code?

2005-07-02 Thread Sébastien Boisgérault
Nathan Pinno a écrit : Hi all, What's wrong with the following code? It says there is name error, that random is not defined. How do I fix it? Add import random at the top of your file Cheers, SB # Plays the guessing game higher or lower. # Originally written by Josh Cogliati,

Re: What's wrong with this code?

2005-07-02 Thread Robert Kern
Nathan Pinno wrote: Hi all, What's wrong with the following code? It says there is name error, that random is not defined. How do I fix it? You need to import random. -- Robert Kern [EMAIL PROTECTED] In the fields of hell where the grass grows high Are the graves of dreams allowed

A brief question.

2005-07-02 Thread Nathan Pinno
Hi all, Brief question for anyone who knows the answer, because I don't. Is there anyway to make Python calculate square roots? Thanks, Nathan Pinnohttp://www.npinnowebsite.ca/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite non-python language trick?

2005-07-02 Thread Bernhard Herzog
Scott David Daniels [EMAIL PROTECTED] writes: Rocco Moretti wrote: Joseph Garvin wrote: I'm not aware of a language that allows it, but recently I've found myself wanting the ability to transparently replace objects I mainly look for it in the object replaces self form, but I guess you

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-02 Thread Walter Brunswick
Why not just update the local dictionary? class Grouping: def __init__(self,x,y,z): self.__dict__.update(locals()) -- http://mail.python.org/mailman/listinfo/python-list

Re: A brief question.

2005-07-02 Thread Robert Kern
Nathan Pinno wrote: Hi all, Brief question for anyone who knows the answer, because I don't. Is there anyway to make Python calculate square roots? http://docs.python.org/ There is a search facility. -- Robert Kern [EMAIL PROTECTED] In the fields of hell where the

Re: email link and foreign accent

2005-07-02 Thread Peter Hansen
Vittorio wrote: printa href=mailto:%s; %(campovalore.encode('iso-8859-1')) print campovalore.encode('iso-8859-1') print /a campovalore is an email address with special (italian) characters. [snip] Any suggestion is welcome, It might help if you showed us the output of repr(x) where x is

Re: Inheriting from object

2005-07-02 Thread Bengt Richter
On Thu, 30 Jun 2005 08:54:31 -0700, Scott David Daniels [EMAIL PROTECTED] wrote: Sion Arrowsmith wrote: ... And if you were to do so, surely: class foo(object): def __init__(self, *args, **kwargs): super(foo, self).__init__(self) would be the preferred way to go? Or, perhaps:

Re: What are the other options against Zope?

2005-07-02 Thread Peter Hansen
Florian Lindner wrote: Peter Hansen wrote: [Zope] doesn't include database interfaces other than to its own ZODB. That's not correct. Zope2 includes DB interfaces to MySQL, PostGre, ODBC and many others. It actually *includes* them? I thought those were all add-in modules, not ones that

Re: Inheriting from object

2005-07-02 Thread Peter Hansen
Bengt Richter wrote: BTW, there's something about referring to type(self) by its not always dependably bound (though usually global) name that bothers me. I wonder if the above common use of super could be implemented as a property of object, so you'd normally inherit it and be able to

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-02 Thread Roy Smith
In article [EMAIL PROTECTED], Walter Brunswick [EMAIL PROTECTED] wrote: Why not just update the local dictionary? class Grouping: def __init__(self,x,y,z): self.__dict__.update(locals()) That's pretty clever. The only minor annoyance is that it creates a self.self. If that

Re: Bad Math

2005-07-02 Thread Brian van den Broek
Patrick Rutkowski said unto the world upon 02/07/2005 09:25: On 7/2/05, Brian van den Broek [EMAIL PROTECTED] wrote: Patrick Rutkowski said unto the world upon 02/07/2005 00:12: That's... annoying, to say the least. And my number 4/5 was a rational number too; I can understand how when doing

Re: Inheriting from object

2005-07-02 Thread Scott David Daniels
Bengt Richter wrote: On Thu, 30 Jun 2005 08:54:31 -0700, Scott David Daniels [EMAIL PROTECTED] wrote: Or, perhaps: class foo(object): def __init__(self, *args, **kwargs): super(foo, self).__init__(self, *args, **kwargs) ... Doesn't super(foo,

Re: Modules for inclusion in standard library?

2005-07-02 Thread Terry Reedy
Colin J. Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Isn't this where the discussion should start? There should be some general policy guiding the types of modules which should be in the standard library. A couple of times, Guido has given his general policy as generally

Re: A brief question.

2005-07-02 Thread Terry Reedy
Nathan Pinno [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Brief question for anyone who knows the answer, because I don't. Is there anyway to make Python calculate square roots? Python can calculate any calculable function of the objects it has to work with. So the answer

Re: wxPython: Terminal Output - Scrollable Panel?

2005-07-02 Thread flamesrock
Thanks much for your response. I looked at PyCrust, and while its given me a few cool ideas, I may have described the problem incorrectly. What I really need is not something that takes input, but merely redirects the 'print' statements to something like a terminal window. Is this even possible

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-02 Thread jcarlson
Ralf W. Grosse-Kunstleve wrote: A shorter alternative (my personal favorite since minimally redundant):: class grouping: def __init__(self, .keep_this, .and_this, but_not_this, .but_this_again): # real code right here There is also the variant which I proposed on

Re: wxPython: Terminal Output - Scrollable Panel?

2005-07-02 Thread Peter Hansen
flamesrock wrote: I looked at PyCrust, and while its given me a few cool ideas, I may have described the problem incorrectly. What I really need is not something that takes input, but merely redirects the 'print' statements to something like a terminal window. Is this even possible without

Determining actual elapsed (wall-clock) time

2005-07-02 Thread Peter Hansen
I would like to determine the actual elapsed time of an operation which could take place during a time change, in a platform-independent manner (at least across Linux/Windows machines). Using time.time() doesn't appear to be suitable, since time might jump forwards or backwards at the user's

Re: wxPython: Terminal Output - Scrollable Panel?

2005-07-02 Thread flamesrock
Exactly what I'm looking for! Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining actual elapsed (wall-clock) time

2005-07-02 Thread Peter Hansen
Roy Smith wrote: Peter Hansen [EMAIL PROTECTED] wrote: If you get the UTC time, daylight savings time doesn't enter the equation. Of course... I didn't think of that approach. I don't actually care about absolute time, so this should work fine for at least the DST case. If you care about

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-02 Thread Mike C. Fletcher
Ralf W. Grosse-Kunstleve wrote: ... class grouping: def __init__(self, x, y, z): self.x = x self.y = y self.z = z # real code, finally This becomes a serious nuisance in complex applications with long argument lists, especially if long

Re: Python, mysql, floating point values question

2005-07-02 Thread Terry Hancock
On Friday 01 July 2005 11:13 pm, John Machin wrote: x BETWEEN y AND z Ah, even better, thank you. The python equivalent would be to write it out as: if a b-epsilon and a b+epsilon: print a~=b Try this: if b-epsilon a b+epsilon: This I knew, but I was trying to

Re: When someone from Britain speaks, Americans hear a British accent...

2005-07-02 Thread TZOTZIOY
On 28 Jun 2005 13:24:42 -0700, rumours say that muldoon [EMAIL PROTECTED] might have written: Now, what forum would you recommend? Any help would be appreciated. alt.usage.english? alt.languages.english? alt.english.usage? uk.culture.language.english? -- TZOTZIOY, I speak England very best.

Re: When someone from Britain speaks, Americans hear a British accent...

2005-07-02 Thread TZOTZIOY
On Thu, 30 Jun 2005 18:29:56 +0100, rumours say that Tom Anderson [EMAIL PROTECTED] might have written: On Thu, 30 Jun 2005, Benji York wrote: python-needs-more-duct-tape'ly yours, You're in luck: Python 3000 will replace duck typing with duct taping. I would bet that somewhere in the

Re: Python for everything?

2005-07-02 Thread TZOTZIOY
On Thu, 30 Jun 2005 20:55:20 -0400, rumours say that Mike Meyer [EMAIL PROTECTED] might have written: Actually, I was thinking of pre-KR Unix compilers. There must be something I am missing here, cause I don't understand what you mean; what is the earliest KR C compiler (Unix compiler) you

Re: shelve in a ZipFile?

2005-07-02 Thread Terry Hancock
On Friday 01 July 2005 04:40 pm, Andreas Kostyrka wrote: It's even worse: shelve is basically a class that wraps a dictionary. It provides a dictionary string - pickable object based on a dictioary string - string. bsddb, gdbm etc. probably access files via lowlevel calls that are not

Re: Determining actual elapsed (wall-clock) time

2005-07-02 Thread Roy Smith
Peter Hansen [EMAIL PROTECTED] wrote: I guess as long as the NTP client is set up to ensure the time adjustments are smaller than some value X, it would be acceptable. NTP is generally capable of keeping the various system clocks on a LAN within a few ms of each other, and within a few 10's

Re: Python for everything?

2005-07-02 Thread Roy Smith
Christos TZOTZIOY Georgiou [EMAIL PROTECTED] wrote: Were there other Unix C compilers before KR wrote one? Considering that KR (along with T) invented both Unix and C, I would say that the answer to the above has to be No. -- http://mail.python.org/mailman/listinfo/python-list

Re: What are the other options against Zope?

2005-07-02 Thread Terry Hancock
On Saturday 02 July 2005 10:55 am, phil wrote: Zope is like that to me. I ask what is it and the answer sounds like Oh, it's oierbv for the zxcvioupo of 7cvn^djh'. Now understand, I know what very well what Python, Apache, PhP, MySQL, IE and javascript do. I just don't know what Zope

Re: What are the other options against Zope?

2005-07-02 Thread [EMAIL PROTECTED]
If you're looking for a leight weight web development enviroment acting as a front end for a database take a look at http://www.cherrypy.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-02 Thread Terry Hancock
On Saturday 02 July 2005 05:04 am, Ralf W. Grosse-Kunstleve wrote: I often find myself writing:: class grouping: def __init__(self, x, y, z): self.x = x self.y = y self.z = z # real code, finally Fortunately, you don't have

Re: Running Python interpreter in Emacs

2005-07-02 Thread Rex Eastbourne
Yes, I knew that copying it to my root was a kludge. But between that and not having it work, I chose the former. (As you might be able to tell from my posts, I tried multiple things and was frustrated.) I tried putting quotes around c:\program files\python24. It still didn't work. I chose to

Re: Python, mysql, floating point values question

2005-07-02 Thread Christopher Kang
Thanx all for responding. I've been doing the epsilon comparisons, i had just hoped that to be a temporary solution. anyway, thanx for the responses -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining actual elapsed (wall-clock) time

2005-07-02 Thread Peter Hansen
Roy Smith wrote: Peter Hansen [EMAIL PROTECTED] wrote: I'll have to look into how to set up Windows XP to prevent users from changing the time on their own, assuming that's possible. On a single-user system like Windows, you pretty much have to assume the user can do anything. They can

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Jun 29)

2005-07-02 Thread John Machin
Christos TZOTZIOY Georgiou wrote: On Fri, 01 Jul 2005 23:45:57 +1000, rumours say that John Machin [EMAIL PROTECTED] might have written: Simon Brunning wrote: On 7/1/05, Peter Maas [EMAIL PROTECTED] wrote: Simon Brunning schrieb: Sibylle Koczian needs to sort part of a list. His

Re: What's wrong with this code?

2005-07-02 Thread Tim Roberts
Nathan Pinno [EMAIL PROTECTED] wrote: Hi all, What's wrong with the following code? It says there is name error, that random is not defined. How do I fix it? # Plays the guessing game higher or lower. # Originally written by Josh Cogliati, improved first by Quique, then by Nathan Pinno.

Re: Determining actual elapsed (wall-clock) time

2005-07-02 Thread Peter Hansen
Roy Smith wrote: Peter Hansen [EMAIL PROTECTED] wrote: Using time.time() doesn't appear to be suitable, since time might jump forwards or backwards at the user's whim, if the system clock is reset, or when a daylight savings time change occurs. If you get the UTC time, daylight savings time

Re: Determining actual elapsed (wall-clock) time

2005-07-02 Thread Tim Peters
[Peter Hansen] Hmmm... not only that, but at least under XP the return value of time.time() _is_ UTC. At least, it's entirely unaffected by the daylight savings time change, or (apparently) by changes in time zone. On all platforms, time.time() returns the number of seconds since the epoch.

Re: A brief question.

2005-07-02 Thread Tom Brown
On Saturday 02 July 2005 10:55, Nathan Pinno wrote: Brief question for anyone who knows the answer, because I don't. Is there anyway to make Python calculate square roots? from math import sqrt -- http://mail.python.org/mailman/listinfo/python-list

Re: What's wrong with this code?

2005-07-02 Thread John Machin
Nathan Pinno wrote: Hi all, What's wrong with the following code? It says there is name error, that random is not defined. How do I fix it? Others have already answered that question. This posting is a pre-emptive strike to head off the next half-a-dozen questions. # Plays the

Re: A brief question.

2005-07-02 Thread Tom Anderson
On Sat, 2 Jul 2005, Tom Brown wrote: On Saturday 02 July 2005 10:55, Nathan Pinno wrote: Brief question for anyone who knows the answer, because I don't. Is there anyway to make Python calculate square roots? from math import sqrt That's one way. I'd do: root = value ** 0.5 Does that

Re: Regular Expression for pattern substitution

2005-07-02 Thread James Stroud
You might want to be a little more explicit. Do you know that this = this that = that or do you mean this = `the part before the \D*` that = `the part after the \D*` If you mean the former, then the previously proposed py import re py line = 'see this man with that woman holding this dog and

Re: Determining actual elapsed (wall-clock) time

2005-07-02 Thread John Machin
Roy Smith wrote: Peter Hansen [EMAIL PROTECTED] wrote: I guess as long as the NTP client is set up to ensure the time adjustments are smaller than some value X, it would be acceptable. NTP is generally capable of keeping the various system clocks on a LAN within a few ms of each other,

Re: A brief question.

2005-07-02 Thread Fredrik Johansson
On 7/3/05, Tom Anderson [EMAIL PROTECTED] wrote: That's one way. I'd do: root = value ** 0.5 Does that mean we can expect Guido to drop math.sqrt in py3k? :) I'd rather like to see a well implemented math.nthroot. 64**(1/3.0) gives 3.9996, and this error could be avoided.

Re: What's wrong with this code?

2005-07-02 Thread John Machin
John Machin wrote: Nathan Pinno wrote: guess = input(Guess a number: ) guess will refer to a string e.g. 42 which will *not* compare equal to the integer 42. Also you should use raw_input, not input. so do this: guess = int(raw_input(Guess a number: )) Ahem ... I'll redo

Re: Inheriting from object

2005-07-02 Thread Steven Bethard
Bengt Richter wrote: I wonder if the above common use of super could be implemented as a property of object, so you'd normally inherit it and be able to write self.super.__init__(*args, **kwargs) # (maybe spell it self.__super__.__init__(...) I suppose) I.e., self.__super__ would

Re: When someone from Britain speaks, Americans hear a British accent...

2005-07-02 Thread Darkfalz
muldoon wrote: Americans consider having a British accent a sign of sophistication and high intelligence. Many companies hire salespersons from Britain to represent their products,etc. Question: When the British hear an American accent, does it sound unsophisticated and dumb? Be blunt. We

Re: Favorite non-python language trick?

2005-07-02 Thread Steven D'Aprano
On Fri, 01 Jul 2005 12:24:44 -0700, Devan L wrote: With the exception of reduce(lambda x,y:x*y, sequence), reduce can be replaced with sum, and Guido wants to add a product function. How do you replace: reduce(lambda x,y: x*y-1/y, sequence) with sum? Inquiring minds want to know. --

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Steven D'Aprano
On Fri, 01 Jul 2005 09:13:58 -0700, mcherm wrote: Lambda serves a very specific purpose: declaring small, in-place functions which are no bigger than a single expression. I do this often enough that I DO want special syntax for it. But I'll admit that I wish lambda were about 5 or 6

Re: Assigning to None (was Re: Question about Python)

2005-07-02 Thread Steven D'Aprano
On Fri, 01 Jul 2005 12:59:20 -0400, François Pinard wrote: [Peter Hansen] Mike Meyer wrote: Yes. I once grabbed an old program that did assignments to None. But that's always been a bad idea. What was the use case!? People used to assign None to itself as a keyword argument in

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Steven D'Aprano
On Fri, 01 Jul 2005 13:42:10 -0400, Mike Meyer wrote: iK [EMAIL PROTECTED] writes: Seems like he wants python programmers to solve their problems all in the same way. While that is great for corporate slaves it is terrible for the creative programmer. No, he wants Python to be

Re: Inheriting from object

2005-07-02 Thread John Roth
Bengt Richter [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I wonder if the above common use of super could be implemented as a property of object, so you'd normally inherit it and be able to write self.super.__init__(*args, **kwargs) # (maybe spell it

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Steven D'Aprano
On Fri, 01 Jul 2005 19:15:46 -0700, Erik Max Francis wrote: Sean McIlroy wrote: if that's the case then list comprehensions and/or first class functions are likely to be the next target. Slippery slope arguments are logical fallacies, you know. Not if you are actually standing on a

  1   2   >