Re: Python Book

2005-11-13 Thread Kent Johnson
David Rasmussen wrote: > What is the best book for Python newbies (seasoned programmer in other > languages)? I like Learning Python. Python in a Nutshell is good if you want something brief. Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe, pyparallel

2005-11-13 Thread Chris Mellon
On 13 Nov 2005 10:03:52 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm using py2exe to create a standalone program that uses pyparallel. > When I run the created program an error occurs and a message directs me > to > the log file which contains: > > Traceback (most recent call last): >

Re: Copyright [was Re: Python Obfuscation]

2005-11-13 Thread Alex Martelli
David T <[EMAIL PROTECTED]> wrote: ... > Tom Edison moved to California so _he_ could skirt copyright laws of I'm not aware of any move to California for either the better-known Thomas Alva Edison, or his lesser-known and less successful son of the same name. Could you clarify? The movie indu

Re: Iterator addition

2005-11-13 Thread Bengt Richter
On Sun, 13 Nov 2005 17:28:59 -0600, [EMAIL PROTECTED] wrote: [...] > >On Sun, Nov 13, 2005 at 09:44:43PM +, Bengt Richter wrote: >> even if expr1 had a __unaryop__ method, >> expr1 - expr2 >> could not become >> expr1.__unaryop__(-expr2) >> unless you forced the issue with >> expr1

gmpy 1.01 binaries for the mac

2005-11-13 Thread Alex Martelli
I've added to gmpy.sf.net two binary packages of gmpy for Mac OS X 10.4, one for the Python 2.3.5 that comes with the system and one for Bob Ippolito's build of 2.4.1. They still need GMP to be previously installed (I'm told the one that comes with fink works; I installed my own from sources, from

Re: Hash map with multiple keys per value ?

2005-11-13 Thread Bengt Richter
On Fri, 11 Nov 2005 22:55:53 +, Chris Stiles <[EMAIL PROTECTED]> wrote: >Hi -- > >I'm working on something that includes the concept of multiple aliases for a >particular object, where a lookup for any of the aliases has to return all the >others. The hack way of doing this was to have a dict

gmpy/decimal interoperation

2005-11-13 Thread Alex Martelli
As things stand now (gmpy 1.01), an instance d of decimal.Decimal cannot transparently become an instance of any of gmpy.{mpz, mpq, mpf}, nor vice versa (the conversions are all possible, but a bit laborious, e.g. by explicitly going through string-forms). I'm thinking about possible ways to fix t

Trouble with "freeze.py" importing 3rd Party Modules

2005-11-13 Thread Michael Williams
Can anyone explain why "freeze.py" will make binaries with the std modules fine, however, when using 3rd party modules (Pexpect in particular) it requires the target system to actually have it installed? Thanks in advance, Mike -- http://mail.python.org/mailman/listinfo/python-list

Sorting dominoes

2005-11-13 Thread DaveM
Essentially, I'm trying to sort 12 dominoes. Each domino has two different numbers and there are two of every number. Identical dominoes are possible, but doubles are not. The problem is to place the dominoes in a line, side to side, so that two columns (or rows, depending how you orientate them)

Re: py2exe, pyparallel

2005-11-13 Thread garyr
Chris Mellon wrote: > On 13 Nov 2005 10:03:52 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I'm using py2exe to create a standalone program that uses pyparallel. > > When I run the created program an error occurs and a message directs me > > to > > the log file which contains: > > > > Tr

Re: Copyright [was Re: Python Obfuscation]

2005-11-13 Thread David T
I realize that this thread skirts with being OT, but there are serious implications for Pythonistas and Open Source software types. I didn't mean to suggest that T.E. moved to California. I did, however, misspeak (mis-type?) when I said Edison formed a studio in California. His was in NJ, ac

Re: Sorting dominoes

2005-11-13 Thread jepler
So if you have the dominoes (1 2), (3 2) and (3 1) you must arrange them as 1|2|3 2|3|1 ? If so, then it seems to me your algorithm is this: 1. pick an arbitrary domino to be first, and an arbitrary side to be the "top" 2a. until the dominoes are exhausted, pick the other domino wi

Re: Sorting dominoes

2005-11-13 Thread Yu-Xi Lim
DaveM wrote: > Essentially, I'm trying to sort 12 dominoes. Each domino has two different > numbers and there are two of every number. Identical dominoes are possible, > but doubles are not. > > The problem is to place the dominoes in a line, side to side, so that two > columns (or rows, depending

Re: Abstract Base Classes

2005-11-13 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> wrote: > I want my modules to (sometimes) define an abstract base exception > class, that all other exceptions in that module inherit from. Not a whole lot of feedback on this, so here's the implementation I decided upon. class FooException(Exception): "

Re: Abstract Base Classes

2005-11-13 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> wrote: > I want my modules to (sometimes) define an abstract base exception > class, that all other exceptions in that module inherit from. [re-posting with the implementation properly foo-ified] Not a whole lot of feedback on this, so here's the implementation I de

Dictionary of tuples from query question

2005-11-13 Thread David Pratt
Hi. I am interested in having results from a db query in the following form. {1: (value0, value1, value2,), 2: (value0, value1, value2,), 3: (value0, value1, value2,)} so I generate a dictionary of tuples (field values) dynamically so if I queried a table with five fields I would have five field

Re: PySizer 0.1

2005-11-13 Thread Claudio Grondi
A small hint about the Web-site: At least to me, the links to the documentation as e.g. http://pysizer.8325.org/doc/auto/home/nick/sizer-trunk/doc/auto/scanner.html are broken (no big thing, because the distro has it anyway). Claudio "Nick Smallbone" <[EMAIL PROTECTED]> schrieb im Newsbeitrag ne

modifying small chunks from long string

2005-11-13 Thread MackS
Hello everyone I am faced with the following problem. For the first time I've asked myself "might this actually be easier to code in C rather than in python?", and I am not looking at device drivers. : ) This program is meant to process relatively long strings (10-20 MB) by selectively modifying

Re: Abstract Base Classes

2005-11-13 Thread Steven D'Aprano
Ben Finney wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: > >>I want my modules to (sometimes) define an abstract base exception >>class, that all other exceptions in that module inherit from. > > > [re-posting with the implementation properly foo-ified] Isn't the proper Python idiom to use Mon

HOW do you stop a print???

2005-11-13 Thread john boy
ok...I am running the following program:   def printMultiples (n): i = 1 while i <= 6:  print n*i,   ' \t ', i = i + 1 i = 1 while i <= 6: printMultiples(i) i = i + 1   this is supposed to return a simple multiplication table, but for some reason it does not want to s

<    1   2