Re: merits of Lisp vs Python

2006-12-16 Thread Bill Atkins
greg <[EMAIL PROTECTED]> writes: > André Thieme wrote: >> (aif (timeConsumingCalculation) >> (use it)) > > I think the answer is that you just wouldn't do > that in Python at all. Having magic variables > spring into existence in your local namespace > as a side effect of calling something i

Re: merits of Lisp vs Python

2006-12-16 Thread Bill Atkins
greg <[EMAIL PROTECTED]> writes: > Ken Tilton wrote: > >> McCarthy: "Is code also data in Python?" >> Norvig: "No." > > I don't think that was the right answer. He should have > said "Yes", and then shown McCarthy eval() and exec. > > Code isn't quite as *convenient* to work with as data > in Pyth

Re: tuple.index()

2006-12-16 Thread greg
Nick Maclaren wrote: > A collection is inhomogeneous if, for some attribute that is needed > for at least one action on at least one element of the collection, > the attribute is not shared by all elements of the collection. If you mean "attribute" in the Python sense, then this is wr

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread John Nagle
Sandra-24 wrote: > Comparing file system paths as strings is very brittle. Is there a > better way to test if two paths point to the same file or directory > (and that will work across platforms?) No. There are ways to do it for many operating systems, but there is no system-independent

OT : Bug/Issue tracking systems

2006-12-16 Thread moogyd
Hi, (Off-topic) I am looking to put an open-source bug/issue tracking system in place for our current project (eventually expanded for all projects), and would appreciate any experiences/comments/suggestions. Note the project is encompasses embedded hardware (ASIC plus firmware) plus application

Re: textwrap.dedent replaces tabs?

2006-12-16 Thread Tom Plunket
CakeProphet wrote: > Hmmm... a quick fix might be to temporarily replace all tab characters > with another, relatively unused control character. > > MyString = MyString.replace("\t", chr(1)) > MyString = textwrap.dedent(MyString) > MyString = MyString.replace(chr(1), "\t") > > Of course... this

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread Erik Max Francis
Leif K-Brooks wrote: > ~ is interpreted as "my home directory" by the shell, but when it's used > in a path, it has no special meaning. open('~/foo.txt') tries to open a > file called foo.txt in a subdirectory of the current directory called '~'. That's what os.path.expanduser is for. -- Erik

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread Leif K-Brooks
Tim Chase wrote: >>> Comparing file system paths as strings is very brittle. >> >> Why do you say that? Are you thinking of something like this? >> >> /home//user/somedirectory/../file >> /home/user/file > > Or even > > ~/file ~ is interpreted as "my home directory" by the shell, but when it

Smarter way to do this? Unicode + stdin, stdout

2006-12-16 Thread BenjaMinster
I want to read and write unicode on stdin and stdout. I can't seem to find any way to force sys.stdin.encoding and sys.stdout.encoding to be utf-8, so I've got the following workaround: import codecs, sys out = codecs.getwriter("utf-8")(sys.stdout) def tricky(): return sys.stdin.readline().decod

Re: module wide metaclass for new style classes

2006-12-16 Thread Gabriel Genellina
On 16 dic, 14:44, "Daniel Nogradi" <[EMAIL PROTECTED]> wrote: > I used to have the following code to collect all (old style) class > names defined in the current module to a list called reg: > > def meta( reg ): > def _meta( name, bases, dictionary ): > reg.append( name ) > return

Re: Good Looking UI for a stand alone application

2006-12-16 Thread Sandra-24
On 12/16/06, The Night Blogger <[EMAIL PROTECTED]> wrote: > Can someone recommend me a good API for writing a sexy looking (Rich UI like > WinForms) shrink wrap application > My requirement is that the application needs to look as good on Windows as > on the Apple Mac wxPython or something layere

Re: Is there a way to push data into Microsoft Oulook from Python ?

2006-12-16 Thread Gabriel Genellina
On 16 dic, 17:39, "The Night Blogger" <[EMAIL PROTECTED]> wrote: > Is there a way to pull & push data (Tasks, Notes, Calendar Items ...) into > Microsoft Oulook from Python ? You will need the pywin32 package. Then you get the Outlook Application object using: import win32com.client Outlook = w

Re: wxPython help please

2006-12-16 Thread Sandra-24
On Dec 16, 8:43 pm, Jive Dadson <[EMAIL PROTECTED]> wrote: >I bought the ebook. Searching for "pixel", all I came up with was a > method called GetPixel in a "device context." I know there must be a > device context buried in there somewhere, so now I need to winkle it out. You are right that yo

Re: merits of Lisp vs Python

2006-12-16 Thread John Thingstad
On Sun, 17 Dec 2006 00:19:40 +0100, > wrote: > > Incorrect, I believe. The above is like saying Lisp's lack of > optional manual storage allocation and machine pointers makes Lisp > less powerful. It's in fact the absence of those features that lets > garbage collection work reliably. Reliable

Re: Has comparison of instancemethods changed between python 2.5 and 2.4?

2006-12-16 Thread Carl Banks
Frank Niessink wrote: > Ziga Seilnacht: > > This method was changed in Python 2.5. Previously, two instancemethods > > compared equal if their im_self attributes were *identical* and their > > im_func attributes were equal. Now, they compare equal if their im_self > > attributes are *equal* and the

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread John Machin
Tim Chase wrote: > >>> Comparing file system paths as strings is very brittle. Is there a > >>> better way to test if two paths point to the same file or directory > >>> (and that will work across platforms?) > >>os.path.samefile(filename1, filename2) > >>os.path.sameopenfile(fileobject1,

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread Sandra-24
On Dec 16, 8:30 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 16 Dec 2006 17:02:04 -0800, Sandra-24 wrote: > > Comparing file system paths as strings is very brittle.Why do you say that? > > Are you thinking of something like this? > > /home//user/somedirectory/../file > /home/user/file

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread John Machin
Tim Chase wrote: [snip] > I'd suggest os.path.samefile which should handle case-sensitive > (non-win32) vs case-insensitive (win32) filenames, soft-links, > and hard-links. Not sure it's prescient enough to know if you > have two remote shares, it will unwind them to their full > server-path name

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread Tim Chase
>>> Comparing file system paths as strings is very brittle. Is there a >>> better way to test if two paths point to the same file or directory >>> (and that will work across platforms?) >> os.path.samefile(filename1, filename2) >> os.path.sameopenfile(fileobject1, fileobject2) > > Nice t

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread Steven D'Aprano
On Sun, 17 Dec 2006 12:30:15 +1100, Steven D'Aprano wrote: >> Is there a >> better way to test if two paths point to the same file or directory >> (and that will work across platforms?) > > How complicated do you want to get? If you are thinking about aliases, > hard links, shortcuts, SMB shares

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread Tim Chase
>> Comparing file system paths as strings is very brittle. > > Why do you say that? Are you thinking of something like this? > > /home//user/somedirectory/../file > /home/user/file Or even ~/file > How complicated do you want to get? If you are thinking about aliases, > hard links, sho

Re: wxPython help please

2006-12-16 Thread Jive Dadson
Sandra-24 wrote: > Try the wxPython mailing list, which you can find on their site. And > the best wxPython reference is the book (also available as an e-book) > by Robin Dunn, who created wxPython. Seeing wxPython from his > perspective is well worth the money. If I recall correctly he devoted > a

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread John Machin
Tim Chase wrote: > > Comparing file system paths as strings is very brittle. Is there a > > better way to test if two paths point to the same file or directory > > (and that will work across platforms?) > > os.path.samefile(filename1, filename2) > os.path.sameopenfile(fileobject1, file

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread Steven D'Aprano
On Sat, 16 Dec 2006 17:02:04 -0800, Sandra-24 wrote: > Comparing file system paths as strings is very brittle. Why do you say that? Are you thinking of something like this? /home//user/somedirectory/../file /home/user/file Both point to the same file. > Is there a > better way to test if two p

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread Tim Chase
> Comparing file system paths as strings is very brittle. Is there a > better way to test if two paths point to the same file or directory > (and that will work across platforms?) os.path.samefile(filename1, filename2) os.path.sameopenfile(fileobject1, fileobject2) -tkc -- htt

Re: wxPython help please

2006-12-16 Thread Jive Dadson
Sandra-24 wrote: > Try the wxPython mailing list, which you can find on their site. And > the best wxPython reference is the book (also available as an e-book) > by Robin Dunn, who created wxPython. Seeing wxPython from his > perspective is well worth the money. If I recall correctly he devoted > a

How to test if two strings point to the same file or directory?

2006-12-16 Thread Sandra-24
Comparing file system paths as strings is very brittle. Is there a better way to test if two paths point to the same file or directory (and that will work across platforms?) Thanks, -Sandra -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython help please

2006-12-16 Thread Sandra-24
Try the wxPython mailing list, which you can find on their site. And the best wxPython reference is the book (also available as an e-book) by Robin Dunn, who created wxPython. Seeing wxPython from his perspective is well worth the money. If I recall correctly he devoted an entire chapter to drawing

Re: merits of Lisp vs Python

2006-12-16 Thread greg
Ken Tilton wrote: > How does a generic engine that sees only a solution (a > list of mathematical expressions and for each the transformations, > results, and opnds logged by individual TF functions) build up this > environment such that it has named attributes such as signed-value? How did yo

Re: catching exceptions

2006-12-16 Thread Gabriel Genellina
On 16 dic, 10:24, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > Python isn't Java. Are you sure you need properties? > I do not know Java. But, object.x = value looks much better than > object.set_x(value) . Is there any harm in doing it, provided I have to > do more than just storing the val

Re: Package vs. module

2006-12-16 Thread Gabriel Genellina
On 16 dic, 12:28, "Stuart D. Gathman" <[EMAIL PROTECTED]> wrote: > NOW, this is all very nice and modular. BUT, the original module was a > single file, which could be run as a script as well as imported as a > module. The script features provided useful command line functionality. > (Using if __n

Re: catching exceptions

2006-12-16 Thread Steven D'Aprano
On Sat, 16 Dec 2006 05:24:28 -0800, [EMAIL PROTECTED] wrote: >> > Hi, In the following program, I have a class Test which has a property >> > x. Its setx function gets a string value and converts it into a float >> > and stores into it. >> >> [snip code] >> >> Python isn't Java. Are you sure you n

wxPython help please

2006-12-16 Thread Jive Dadson
I hope someone can help me with a couple of wxPython questions, or point me to the right newsgroup for the questions. I am trying to modify the floatcanvas demo program. I want to load an image from a file (jpg or whatever), then do a kind of color-picker action on it. I haven't tried yet to

Re: Is there a way to push data into Microsoft Excel & Word from Python ?

2006-12-16 Thread Paul Boddie
Caleb Hattingh wrote: > Paul Boddie has written a great tutorial---which includes some Outlook > examples, btw---over here: > > http://thor.prohosting.com/~pboddie/Python/COM.html Thanks for the kind words! The most current location of this tutorial is here: http://www.boddie.org.uk/python/COM.ht

Re: Is there a way to push data into Microsoft Excel & Word from Python ?

2006-12-16 Thread John Machin
The Night Blogger wrote: > Is there a way to push data to Microsoft Excel & Word from a Python > Application > > Is this a cross platform feature ? I'll need to push data on MS Windows & > Mac OS X Depends on what you mean by "push". If you wish to create Excel files but not update existing

Re: Roundtrip SQL data especially datetime

2006-12-16 Thread John Machin
Carsten Haese wrote: > On Sat, 2006-12-16 at 20:48 +, John Nagle wrote: > > The SourceForge page > > > >http://sourceforge.net/project/showfiles.php?group_id=22307 > > > > says > > > > "MySQL versions 3.23-5.0; and Python versions 2.3-2.4 are supported." > > > > Last release was A

Re: merits of Lisp vs Python

2006-12-16 Thread Paul Rubin
Raffael Cavallaro <[EMAIL PROTECTED]'espam-s'il-vous-plait-mac.com> writes: > > It never occurs to Lisp programmers that Lisp, too, might be a Blub. > > Of course it does - Thats why we try ocaml and haskell etc. It's just > that we don't see the useful features of these languages as being > suffi

Re: Need Simple Way To Determine If File Is Executable

2006-12-16 Thread Gabriel Genellina
On 16 dic, 04:47, Tim Roberts <[EMAIL PROTECTED]> wrote: > > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH >This will tell you that "x.exe" is executable, even if "x.exe" contains > nothing but zeros. Isn't the same with any other recipe, portable or not? Unless the OS actually tries to

Re: textwrap.dedent replaces tabs?

2006-12-16 Thread CakeProphet
Hmmm... a quick fix might be to temporarily replace all tab characters with another, relatively unused control character. MyString = MyString.replace("\t", chr(1)) MyString = textwrap.dedent(MyString) MyString = MyString.replace(chr(1), "\t") Of course... this isn't exactly safe, but it's not goi

Re: inquiry about installing Python 2.5

2006-12-16 Thread Michel Claveau
Hi! For Python only, it's possible. But, if you add Pywin32... problem! -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: inquiry about installing Python 2.5

2006-12-16 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > If possible, I would like to have both Python 2.4 and Python 2.5 > installed on my workstaiton. I downloaded the .msi for Python 2.5 from > the python.org site. If I run the 2.5 installer, will it give me the > option of keeping Python 2.4 installed on my workstation?

Re: Dictionary, iterate & update objects

2006-12-16 Thread jansenh
Hi and thanx! Caleb Hattingh wrote: > > >>> temp=d[12345] > >>> temp.x = 5 > > After I assign the object to the dict with ID=12345, I can easily get > the object by its key and manipulate its state. The last 4 lines show > that the state changed for all the active references to the created > obje

inquiry about installing Python 2.5

2006-12-16 Thread mirandacascade
Apologies in advance for what I'm sure seems like a trivial question. Operating system: Win XP Current version of Python: 2.4 If possible, I would like to have both Python 2.4 and Python 2.5 installed on my workstaiton. I downloaded the .msi for Python 2.5 from the python.org site. If I run the

Re: Dictionary, iterate & update objects

2006-12-16 Thread Caleb Hattingh
jansenh wrote: > hi comp.lang.python. > > I need some newbe advice on idiomatic use of Python dictionaries. > > I have service with a dictionary which holds a bunch of objects as > values, and an ID as key to each object. Then I want to change an > objects state based on its key. The way I am doin

Re: Has comparison of instancemethods changed between python 2.5 and 2.4?

2006-12-16 Thread Frank Niessink
Ziga Seilnacht: > This method was changed in Python 2.5. Previously, two instancemethods > compared equal if their im_self attributes were *identical* and their > im_func attributes were equal. Now, they compare equal if their im_self > attributes are *equal* and their im_func attributes are equal.

Re: Roundtrip SQL data especially datetime

2006-12-16 Thread Carsten Haese
On Sat, 2006-12-16 at 20:48 +, John Nagle wrote: > The SourceForge page > >http://sourceforge.net/project/showfiles.php?group_id=22307 > > says > > "MySQL versions 3.23-5.0; and Python versions 2.3-2.4 are supported." > > Last release was April, 2006. There's no binary for Pyt

Re: How Micro-pump will change the future of computer/ mobile chips.

2006-12-16 Thread Donald
Jim Granville wrote: > [EMAIL PROTECTED] wrote: > >> How Micro-pump will change the future of computer/ mobile chips. > > > FAR more hype than practical solution > Sorry guys, this will not "change the future of computer/ mobile chips." > >> Engineers at Purdue University have developed a t

Re: Is there a way to push data into Microsoft Excel & Word from Python ?

2006-12-16 Thread Caleb Hattingh
The Night Blogger wrote: > Is there a way to push data to Microsoft Excel & Word from a Python > Application On Windows, it's easy after you install the win32 extensions. For example, for python: import win32com.client xl = win32com.client.Dispatch('Excel.Application') after which you can oper

Re: How Micro-pump will change the future of computer/ mobile chips.

2006-12-16 Thread Jim Granville
[EMAIL PROTECTED] wrote: > How Micro-pump will change the future of computer/ mobile chips. FAR more hype than practical solution Sorry guys, this will not "change the future of computer/ mobile chips." > Engineers at Purdue University have developed a tiny "micro-pump" > cooling device small

Re: Over my head with descriptors

2006-12-16 Thread Christian Kastner
Tim Roberts wrote: > "Sarcastic Zombie" <[EMAIL PROTECTED]> wrote: >> Code included below. >> >> Basically, I've created a series of "question" descriptors, which each >> hold a managed value. This is so I can implement validation, and render >> each field into html automatically for forms. >> >> M

Dictionary, iterate & update objects

2006-12-16 Thread jansenh
hi comp.lang.python. I need some newbe advice on idiomatic use of Python dictionaries. I have service with a dictionary which holds a bunch of objects as values, and an ID as key to each object. Then I want to change an objects state based on its key. The way I am doing this now is by using 'from

Re: Over my head with descriptors

2006-12-16 Thread Christian Kastner
Sarcastic Zombie wrote: > Code included below. > > Basically, I've created a series of "question" descriptors, which each > hold a managed value. This is so I can implement validation, and render > each field into html automatically for forms. > > My problem is this: every instance of my "wizard"

Re: Good Looking UI for a stand alone application

2006-12-16 Thread Peter Decker
On 12/16/06, The Night Blogger <[EMAIL PROTECTED]> wrote: > Can someone recommend me a good API for writing a sexy looking (Rich UI like > WinForms) shrink wrap application > > My requirement is that the application needs to look as good on Windows as > on the Apple Mac For my money (even though i

Re: Roundtrip SQL data especially datetime

2006-12-16 Thread John Nagle
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, John Nagle wrote: > >>John Machin wrote: >> >>>John Nagle wrote: >>> dyork wrote: >"John Machin" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] > > > >>If you have, as you should, Python 2.5, y

Re: merits of Lisp vs Python

2006-12-16 Thread Ken Tilton
[EMAIL PROTECTED] wrote: > Ken Tilton wrote: > >>[EMAIL PROTECTED] wrote: >> >>>Code is data is code >> >>I was hoping no one would make that mistake. :) macros are all about >>code is data, but code is not data in Python* so the two words code and >>data serve to differentiate them for Pythonis

Is there a way to push data into Ical from Python ?

2006-12-16 Thread The Night Blogger
Is there a way to pull & push data into (Apple Mac OS X Calendar) Ical from Python ? -- http://mail.python.org/mailman/listinfo/python-list

Re: converting mysql db into sqlite3.

2006-12-16 Thread gordyt
You could probably use the mysqldump command with the proper options to export the contents of your mysql database to an ASCII text file that contains the SQL insert statements. Then you could import that information to a sqlite database file. You may have to massage the export file if it contain

Is there a way to push data into Microsoft Oulook from Python ?

2006-12-16 Thread The Night Blogger
Is there a way to pull & push data (Tasks, Notes, Calendar Items ...) into Microsoft Oulook from Python ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Roundtrip SQL data especially datetime

2006-12-16 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, John Nagle wrote: > John Machin wrote: >> John Nagle wrote: >>>dyork wrote: "John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >If you have, as you should, Python 2.5, you can use this: >>> >>>Actually, MySQLdb isn't released

Re: Is anyone using Python for embedded applications?

2006-12-16 Thread dwhall
Carl, I'm the lead developer for PyMite (http://pymite.python-hosting.com). I do quite a bit of embedded development with PyMite. PyMite is for much smaller target devices (8-bit and 32-bit microcontrollers) than you plan to use. I am currently writing a series of papers that will attempt to dra

textwrap.dedent replaces tabs?

2006-12-16 Thread Tom Plunket
The documentation for dedent says, "Remove any whitespace than can be uniformly removed from the left of every line in `text`", yet I'm finding that it's also modifying the '\t' characters, which is highly undesirable in my application. Is there any way to stop it from doing this, or alternatively

Is there a way to push data into Microsoft Excel & Word from Python ?

2006-12-16 Thread The Night Blogger
Is there a way to push data to Microsoft Excel & Word from a Python Application Is this a cross platform feature ? I'll need to push data on MS Windows & Mac OS X -- http://mail.python.org/mailman/listinfo/python-list

Good Looking UI for a stand alone application

2006-12-16 Thread The Night Blogger
Can someone recommend me a good API for writing a sexy looking (Rich UI like WinForms) shrink wrap application My requirement is that the application needs to look as good on Windows as on the Apple Mac -- http://mail.python.org/mailman/listinfo/python-list

Re: sha, PyCrypto, SHA-256

2006-12-16 Thread Dennis Benzinger
Am 16 Dec 2006 11:17:19 -0800 schrieb [EMAIL PROTECTED]: > Operating system: Win XP > Vsn of Python: 2.4 > > Situation is this: Required to calcluate a message digest. The > process for calcluating the digest must use an SHA-256 algorithm. > > Questions: > 1) Is it correct that the sha module c

Re: merits of Lisp vs Python

2006-12-16 Thread Raffael Cavallaro
On 2006-12-16 13:58:37 -0500, Jon Harrop <[EMAIL PROTECTED]> said: > Why do you think that uniform syntax is necessary to provide new paradigms > when it is equivalent to infix syntax? Because it doesn't require one to write a parser for each new syntax for each new paradigm. > In what way is H

Re: merits of Lisp vs Python

2006-12-16 Thread xscottg
Ken Tilton wrote: > [EMAIL PROTECTED] wrote: > > > > Code is data is code > > I was hoping no one would make that mistake. :) macros are all about > code is data, but code is not data in Python* so the two words code and > data serve to differentiate them for Pythonistas. > I disagree. I frequent

sha, PyCrypto, SHA-256

2006-12-16 Thread mirandacascade
Operating system: Win XP Vsn of Python: 2.4 Situation is this: Required to calcluate a message digest. The process for calcluating the digest must use an SHA-256 algorithm. Questions: 1) Is it correct that the sha module comes with python 2.4? 2) Is it correct that the sha module that ships with

Re: merits of Lisp vs Python

2006-12-16 Thread Kirk Sluder
In article <[EMAIL PROTECTED]>, Kirk Sluder <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Paul Rubin wrote: > > > n! = (n/e)**n * sqrt(2*pi*n) * (1 + (1/12n)) * ... > > If computer languages were to mimic natural languages on this point, > they w

Re: merits of Lisp vs Python

2006-12-16 Thread Jon Harrop
Raffael Cavallaro wrote: > Of course it does - Thats why we try ocaml and haskell etc. It's just > that we don't see the useful features of these languages as being > sufficiently useful to compensate for their lack of the ability to > easily do syntactic abstractions over a uniform syntax. That a

Re: Roundtrip SQL data especially datetime

2006-12-16 Thread John Nagle
John Machin wrote: > John Nagle wrote: > >>dyork wrote: >> >>>"John Machin" <[EMAIL PROTECTED]> wrote in message >>>news:[EMAIL PROTECTED] >>> >>> If you have, as you should, Python 2.5, you can use this: >> >>Actually, MySQLdb isn't released for Python 2.5 yet > > > Actually, that's int

Re: merits of Lisp vs Python

2006-12-16 Thread Kirk Sluder
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > Kirk Sluder <[EMAIL PROTECTED]> writes: > > Personally, I've always preferred use the imperative to describe > > _basic_ math rather than the passive. This would seem to map better to > > RPN than infix. (emphasis

Re: I'm looking for a pythonic red-black tree...

2006-12-16 Thread Stuart D. Gathman
On Fri, 15 Dec 2006 01:20:34 +, Just Another Victim of the Ambient Morality wrote: > I need a red-black tree in Python and I was wondering if there was one > built in or if there's a good implementation out there. Something that, > lets face it, does whatever the C++ std::map<> allows y

Re: merits of Lisp vs Python

2006-12-16 Thread Juan R.
Using LISP-like syntax for everything would be so stupid as using quantum mechanics for billiards. Claiming that LISP parens are Stupid, Superfluous, or Silly just because you do not need them in your limited field of discourse, would be so stupid as those people thinking that just because they us

Re: merits of Lisp vs Python

2006-12-16 Thread Juan R.
Raffael Cavallaro ha escrito: > This lock-in to > a particular paradigm, however powerful, is what makes any such > language strictly less expressive than one with syntactic abstraction > over a uniform syntax. Right, but it would be also remarked that there is not reason to ignoring the developme

module wide metaclass for new style classes

2006-12-16 Thread Daniel Nogradi
I used to have the following code to collect all (old style) class names defined in the current module to a list called reg: def meta( reg ): def _meta( name, bases, dictionary ): reg.append( name ) return _meta reg = [ ] __metaclass__ = meta( reg ) class c1: pass class c2:

Re: win32 service

2006-12-16 Thread g.franzkowiak
Tim Williams schrieb: > On 16/12/06, g.franzkowiak <[EMAIL PROTECTED]> wrote: >> Hi everybody, >> >> have a little problem with a service on Win32. >> >> I use a TCP server as service, but can't access from an other machine. >> Only local access is possible. >> >> The service starts like this: >> >

Re: Roundtrip SQL data especially datetime

2006-12-16 Thread fumanchu
dyork wrote: > Thanks Gabriel, but when I said "round trip" I really did mean: convert all > the way to string and all the way back again, so your kind advice is not all > that helpful. I need string to get to a non-Python object or a Web page. Then you need two adaptation layers: one between your

Re: merits of Lisp vs Python

2006-12-16 Thread Raffael Cavallaro
On 2006-12-16 08:21:59 -0500, Paul Rubin said: > It never occurs to Lisp programmers that Lisp, too, might be a Blub. Of course it does - Thats why we try ocaml and haskell etc. It's just that we don't see the useful features of these languages as being sufficiently u

Re: win32 service

2006-12-16 Thread g.franzkowiak
Tim Williams schrieb: > On 16/12/06, g.franzkowiak <[EMAIL PROTECTED]> wrote: >> Hi everybody, >> >> have a little problem with a service on Win32. >> >> I use a TCP server as service, but can't access from an other machine. >> Only local access is possible. >> >> The service starts like this: >> >

Re: Conditional iteration

2006-12-16 Thread Colin J. Williams
at wrote: > Dear Carl, > > Well, all I can say that for me as a user it would make sense... > > Curiosity: in what sense is it redundant? > All solution/workarounds I have seen so far involve creation of new lists > (subsets) adding to more processing/computation/memory usage. Redundant > suggest

Re: merits of Lisp vs Python

2006-12-16 Thread Ken Tilton
Kay Schluehr wrote: > Ken Tilton schrieb: > > >>Looks promising. How does a generic engine that sees only a solution (a >>list of mathematical expressions and for each the transformations, >>results, and opnds logged by individual TF functions) build up this >>environment such that it has named

Re: Has comparison of instancemethods changed between python 2.5 and 2.4?

2006-12-16 Thread Ziga Seilnacht
Frank Niessink wrote: > I tried to lookup the python source code where the actual comparison > happens. I think it is in methodobject.c (I'm not familiar with the > python source so please correct me if I'm wrong), meth_compare. That > function did not change between python 2.4.4 and 2.5. Moreover,

Package vs. module

2006-12-16 Thread Stuart D. Gathman
On Mon, 11 Dec 2006 20:59:27 -0300, Gabriel Genellina wrote: > The above code *almost* works, but DNSLookup is a local name inside > the function. Use the global statement. > As an example, see how getpass.py (in the standard library) manages > the various getpass implementations. Ok, I have a

Re: win32 service

2006-12-16 Thread Tim Williams
On 16/12/06, g.franzkowiak <[EMAIL PROTECTED]> wrote: > Hi everybody, > > have a little problem with a service on Win32. > > I use a TCP server as service, but can't access from an other machine. > Only local access is possible. > > The service starts like this: > > -> myService.py --username user

Re: how can i write a hello world in chinese with python

2006-12-16 Thread kernel1983
thanks everyone maybe this simple API doesn't fit the Chinese display but thanks everybody! At least I've got that what bundles is and maybe I can use Python to write program On 12月14日, 上午6时31分, "MRAB" <[EMAIL PROTECTED]> wrote: > Dennis Lee Bieber wrote: > > On 12 Dec 2006 23:40:41 -0800, "kerne

win32 service

2006-12-16 Thread g.franzkowiak
Hi everybody, have a little problem with a service on Win32. I use a TCP server as service, but can't access from an other machine. Only local access is possible. The service starts like this: -> myService.py --username user --password password install <- followed by start The user is member

A new text templating system for python!

2006-12-16 Thread Chris Withers
Hi All, I'm proud to announce that after almost a year's development, the first public release of Twiddler is available! Twiddler is a simple but flexible templating system for dynamically generating textual output. The key features are: - No need to learn a templating language. - As simple

Re: merits of Lisp vs Python

2006-12-16 Thread Slawomir Nowaczyk
On Sat, 16 Dec 2006 14:09:11 +0100 André Thieme <[EMAIL PROTECTED]> wrote: #> Sounds like "Blub" to me: #> http://www.paulgraham.com/avg.html Well, too bad for you... #> I will quote some parts of it: #> #> "By induction, the only programmers in a position to see all the #> differences in powe

Re: merits of Lisp vs Python

2006-12-16 Thread André Thieme
Paul Rubin schrieb: > Kirk Sluder <[EMAIL PROTECTED]> writes: >> Personally, I've always preferred use the imperative to describe >> basic math rather than the passive. This would seem to map better to >> RPN than infix. > > For writing down complicated, nested expressions too? That's very >

Re: Routine for prefixing '>' before every line of a string

2006-12-16 Thread Sanjay
Thanks a lot, guys! sanjay -- http://mail.python.org/mailman/listinfo/python-list

Re: catching exceptions

2006-12-16 Thread [EMAIL PROTECTED]
Steven D'Aprano wrote: > On Sat, 16 Dec 2006 03:54:52 -0800, [EMAIL PROTECTED] wrote: > > > Hi, In the following program, I have a class Test which has a property > > x. Its setx function gets a string value and converts it into a float > > and stores into it. > > [snip code] > > Python isn't Java

Re: tuple.index()

2006-12-16 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, James Stroud <[EMAIL PROTECTED]> writes: |> Christoph Zwerschke wrote: |> |> > "Inhomogenous" in some meaning of the word --> tuple |> |> I think that you have nailed it here. I don't think anyone on this list |> is capable of giving a "concrete" (as you have put

Re: merits of Lisp vs Python

2006-12-16 Thread Paul Rubin
André Thieme <[EMAIL PROTECTED]> writes: > Sounds like "Blub" to me: > http://www.paulgraham.com/avg.html It never occurs to Lisp programmers that Lisp, too, might be a Blub. -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-16 Thread André Thieme
greg schrieb: > André Thieme wrote: >> (aif (timeConsumingCalculation) >> (use it)) > > I think the answer is that you just wouldn't do > that in Python at all. Having magic variables > spring into existence in your local namespace > as a side effect of calling something is just > not Python

Re: tuple.index()

2006-12-16 Thread James Stroud
Christoph Zwerschke wrote: > "Inhomogenous" in some meaning of the word --> tuple I think that you have nailed it here. I don't think anyone on this list is capable of giving a "concrete" (as you have put it) operational definition of "inhomogenous". They will resort to use cases and thus cloud

Re: merits of Lisp vs Python

2006-12-16 Thread Hendrik van Rooyen
"greg" <[EMAIL PROTECTED]> > > I once heard mention of a system of units in use at > one time with the odd feature that capacitance came > out in units of length. > > Picture the scene: Hobbyist walks into Dick Smith > store and says "I'd like a 5cm capacitor, please." > This is correct - thin

Re: catching exceptions

2006-12-16 Thread Steven D'Aprano
On Sat, 16 Dec 2006 17:36:00 +0530, Amit Khemka wrote: > If I gather correctly, i guess in case of errors/exceptions in a class > function, you want to get the error string. One thing that comes > straight to my mind is, in such a case use a return statement in > functions with two arguments. > >

Re: catching exceptions

2006-12-16 Thread Steven D'Aprano
On Sat, 16 Dec 2006 03:54:52 -0800, [EMAIL PROTECTED] wrote: > Hi, In the following program, I have a class Test which has a property > x. Its setx function gets a string value and converts it into a float > and stores into it. [snip code] Python isn't Java. Are you sure you need properties? >

Re: Has comparison of instancemethods changed between python 2.5 and 2.4?

2006-12-16 Thread Frank Niessink
Frank Niessink: > OK, so that explains why the id of (two references to the same) > instancemethod(s) may differ. But I'm still confused why two > instancemethods of two different instances can compare as equal. I tried to lookup the python source code where the actual comparison happens. I thi

Re: catching exceptions

2006-12-16 Thread Amit Khemka
On 16 Dec 2006 03:54:52 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, In the following program, I have a class Test which has a property > x. Its setx function gets a string value and converts it into a float > and stores into it. > > class Test(object): > def _getx(self): >

  1   2   >