Re: What's so funny? WAS Re: rotor replacement

2005-01-23 Thread "Martin v. Löwis"
Paul Rubin wrote: If he understood how Python is actually used, he'd understand that any C module is a lot more useful in the core than out of it. This is non-sense. I have been distributing C modules outside the core for quite some time now, and I found that the modules are quite useful. distuti

Re: compile python to binary

2005-01-23 Thread Peter Hansen
Daniel Bickett wrote: Fredrik Lundh wrote: oh, you mean that "python compiler" didn't mean "the python compiler". [snip] I simply inferred that he was using the wrong terminology, being that he said "binary" twice ;-) While I suspect you've guessed correctly at what the OP meant, one should also co

Re: [perl-python] 20050121 file reading & writing

2005-01-23 Thread Bob Smith
Erik Max Francis wrote: Bob Smith wrote: To do this efficiently on a large file (dozens or hundreds of megs), you should use the 'sizehint' parameter so as not to use too much memory: sizehint = 0 mylist = f.readlines(sizehint) It doesn't make any difference. .readlines reads the entire file in

Quoting sql queries with the DB-API

2005-01-23 Thread snacktime
I'm used to using the perl DBI and not very familiar with the python DB-API. I am using PyGreSQL. My question is what is the standard way to quote strings in sql queries? I didn't see any quoting functions in the DB-API docs. Is quoting handled internally by the PyGreSQL module? Also, is this

Re: OT: problems mirroring python-list to c.l.py?

2005-01-23 Thread Peter Hansen
Daniel Bickett wrote: John Lenton wrote: On Sun, Jan 23, 2005 at 01:53:52PM -0500, Daniel Bickett wrote: Is there a reason that Google Groups isn't mirroring python-list exactly like it used to, or is it simply a conspiracy I'm not in on? You should not ask this kind of question in a public forum,

Re: Weakref.ref callbacks and eliminating __del__ methods

2005-01-23 Thread Mike C. Fletcher
Alex Martelli wrote: Mike C. Fletcher <[EMAIL PROTECTED]> wrote: weakref.ref( self, self.close ) but the self.close reference in the instance is going away *before* the object is called. Uh -- what's holding on to this weakref.ref instance? I guess the weakreference _itself_ is goin

Re: Set parity of a string

2005-01-23 Thread Peter Hansen
snacktime wrote: Is there a module that sets the parity of a string? I have an application that needs to communicate with a host using even parity So what I need is before sending the message, convert it from space to even parity. And when I get the response I need to convert that from even to s

Re: how to write a tutorial

2005-01-23 Thread Daniel Bickett
Lucas Raab wrote: > Daniel Bickett wrote: > >>Most texts in computing are written by authors to defend and showcase > >>their existence against their peers. > > > > > > When you aren't busy `showcasing' your ignorance, this is *all* i see > > in everything you write. > > > > Um, maybe that was h

Re: Classical FP problem in python : Hamming problem

2005-01-23 Thread Tim Peters
[Francis Girard] > ... > In the meantime, I couldn't resist to test the new Python features about > laziness on a classical FP problem, i.e. the "Hamming" problem. ... > Nevertheless, while the Haskell version prints Hamming sequence for as long as > I can stand it, and with very little memory cons

Re: [perl-python] 20050121 file reading & writing

2005-01-23 Thread Erik Max Francis
Bob Smith wrote: To do this efficiently on a large file (dozens or hundreds of megs), you should use the 'sizehint' parameter so as not to use too much memory: sizehint = 0 mylist = f.readlines(sizehint) It doesn't make any difference. .readlines reads the entire file into memory at once. -- E

Installer made with bdist_wininst segfaulting...

2005-01-23 Thread Fernando Perez
Hi all, I am seeking advice/help from those with more win32 experience than myself. I am trying to build a proper win32 installer for IPython, after a user did most of the hard work. For the most part, it's working very well, but I am running into a nasty problem, which took me a few hours to fi

Re: Fuzzy matching of postal addresses [1/1]

2005-01-23 Thread Andrew McLean
In article <[EMAIL PROTECTED]>, John Machin <[EMAIL PROTECTED]> writes Andrew McLean wrote: In case anyone is interested, here is the latest. def insCost(tokenList, indx, pos): """The cost of inserting a specific token at a specific normalised position along the sequence.""" if containsNu

Re: Quoting sql queries with the DB-API

2005-01-23 Thread Leif K-Brooks
snacktime wrote: I'm used to using the perl DBI and not very familiar with the python DB-API. I am using PyGreSQL. My question is what is the standard way to quote strings in sql queries? I didn't see any quoting functions in the DB-API docs. Is quoting handled internally by the PyGreSQL module

Re: Weakref.ref callbacks and eliminating __del__ methods

2005-01-23 Thread Tim Peters
[Mike C. Fletcher] > I'm looking at rewriting parts of Twisted and TwistedSNMP to eliminate > __del__ methods (and the memory leaks they create). A worthy goal! > Looking at the docs for 2.3's weakref.ref, there's no mention of whether the > callbacks are held with a strong reference. A callback

Re: Help on project, anyone?

2005-01-23 Thread Steve Menard
Georg Brandl wrote: Hello, to train my Python skills I am looking for some project I can contribute to. I learned Python about one year ago, and had already some programming background behind (I contributed to SharpDevelop for instance), so I'm not the complete newbie. About myself: I'm a 20 year o

python newt under win32

2005-01-23 Thread Gabriel B.
Anyone has any info if there's something similar to Newt lib for win32? Thanks Gabriel -- http://mail.python.org/mailman/listinfo/python-list

Re: Set parity of a string

2005-01-23 Thread Peter Hansen
Peter Hansen wrote: snacktime wrote: Is there a module that sets the parity of a string? As to the specific question: a module is not really required. But here's one for you anyway. It raises an exception if any input character is non-ASCII, otherwise when you call set_parity() with a string and

Re: Help on project, anyone?

2005-01-23 Thread Peter Hansen
Georg Brandl wrote: Hello, to train my Python skills I am looking for some project I can contribute to. I learned Python about one year ago, and had already some programming background behind (I contributed to SharpDevelop for instance), so I'm not the complete newbie. About myself: I'm a 20 year o

Re: Set parity of a string

2005-01-23 Thread John Machin
Peter Hansen wrote: > snacktime wrote: > > Is there a module that sets the parity of a string? I have an > > application that needs to communicate with a host using even parity > > So what I need is before sending the message, convert it from space to > > even parity. And when I get the respons

Re: Set parity of a string

2005-01-23 Thread snacktime
On Sun, 23 Jan 2005 21:00:25 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > Peter Hansen wrote: > > snacktime wrote: > >> Is there a module that sets the parity of a string? > > > > As to the specific question: a module is not really required. > > But here's one for you anyway. It raises an exc

Re: Quoting sql queries with the DB-API

2005-01-23 Thread snacktime
> > Also, is this a good way to use variables in an insert/update > > statement, or is there a better way? > > > > sql = "insert into test(a,b) values('%s','%s')" % (a,b) > > cursor.execute(sql) > > If you do it like this: > > sql = "INSERT INTO test(a, b) VALUES(%s, %s)" # no quotes around the %

Re: how to write a tutorial

2005-01-23 Thread alex23
> the first paragraph of 9.1 "A Word About Terminology" is > epitome of masturbation. I'm tempted to concede this point to you given the sheer overwhelming testament to onanism that is your website but this is just nonsense. Defining terms is *always* necessary, it ensures that participants in wha

Re: JPype and classpath (Was Re: embedding jython in CPython... )

2005-01-23 Thread Steve Menard
[EMAIL PROTECTED] wrote: Thanks for the response. However, I continue to have problems. Allow me to give some more detail. For simplicity of testing, I hard coded the classpath and JVM path (BTW getDefaultJVMPath() returns None on my system) import os, os.path from jpype import * startJVM("C:/jdk1.

Re: how to write a tutorial

2005-01-23 Thread Chris Mattern
alex23 wrote: > Having read your comments on women, I hadn't looked at that part of his site until now. I can only say: gah. Haven't seen something like that since Dave Sim's infamous "Tangent" essay. -- Christopher Mattern "Which one you figure tracked us?" "The ugly one, sir.

Re: Determining if a client PC has an Internet connection

2005-01-23 Thread Dave Brueck
torment wrote: [snip] Have you tried just parsing the output from the command "ipconfig"? It's pretty obvious from the output that might give you if a connection is availible. It's tempting to use ipconfig's output, but the info it gives you is unreliable - you can incorrectly infer the presence o

Re: Fuzzy matching of postal addresses

2005-01-23 Thread Joseph Turian
Andrew, > Basically, I have two databases containing lists of postal addresses and > need to look for matching addresses in the two databases. More > precisely, for each address in database A I want to find a single > matching address in database B. What percent of addresses in A have a unique co

Help with Threading

2005-01-23 Thread Philip Smith
Hi I am fairly new to Python threading and my needs are simple(!) I want to establish a number of threads each of which work on the same computationally intensive problem in different ways. I am using the thread module rather than the threading module. My problem is I can't see how (when one t

Re: how to write a tutorial

2005-01-23 Thread Daniel Bickett
Chris Mattern wrote: > alex23 wrote: > > > Having read your comments on women, > > I hadn't looked at that part of his site until now. I can only say: > gah. Haven't seen something like that since Dave Sim's infamous > "Tangent" essay. It's painfully obvious that it is all for the sole purpose

Asynchronous event handling...?

2005-01-23 Thread Chris Line
The application below has two buttons, 'count' and 'stop'.   When the 'stop' button is selected after 'count', it does not execute until the count command finishes at 500.  Instead, it is desired to stop counting immediately and execute the 'stop' method.   Is there a simple way to handle this situ

Re: how to write a tutorial

2005-01-23 Thread Daniel Bickett
Daniel Bickett wrote: > [snip] > You guys are just begging for a YHBT ;-) I apologize, that should have been "we" -- I was criticizing him too. no-one-wants-to-be-a-hypocrite-ly y'rs, Daniel Bickett -- http://mail.python.org/mailman/listinfo/python-list

Re: compile python to binary

2005-01-23 Thread sam
Fredrik Lundh wrote: Daniel Bickett wrote: I believe Sam was talking about "frozen" python scripts using tools such as py2exe: oh, you mean that "python compiler" didn't mean "the python compiler". here are links to some more tools, btw: http://effbot.org/zone/python-compile.htm Thanks for th

Re: compile python to binary

2005-01-23 Thread sam
Peter Hansen wrote: Daniel Bickett wrote: Fredrik Lundh wrote: oh, you mean that "python compiler" didn't mean "the python compiler". [snip] I simply inferred that he was using the wrong terminology, being that he said "binary" twice ;-) While I suspect you've guessed correctly at what the OP mea

Re: Automatic Windows printer creation?

2005-01-23 Thread Alan Gauld
On Wed, 19 Jan 2005 14:35:22 -0500, "GMane Python" <[EMAIL PROTECTED]> wrote: > Anyone know if there's a module which will allow me to 'create' windows > printer definitions? Not from a Windows domain network, but just to add a > printer that sends to a jet-direct-attached printer. The easiest w

Re: best way to do a series of regexp checks with groups

2005-01-23 Thread Nick Craig-Wood
Mark Fanty <[EMAIL PROTECTED]> wrote: > In perl, I might do (made up example just to illustrate the point): > > if(/add (\d+) (\d+)/) { >do_add($1, $2); > } elsif (/mult (\d+) (\d+)/) { >do_mult($1,$2); > } elsif(/help (\w+)/) { >show_help($1); > } There was a thread about this r

Re: how to write a tutorial

2005-01-23 Thread alex23
Daniel Bickett wrote: > Chris Mattern wrote: > > alex23 wrote: > > > > > Having read your comments on women, > > > > I hadn't looked at that part of his site until now. I can only say: > > gah. Haven't seen something like that since Dave Sim's infamous > > "Tangent" essay. > > It's painfully obvi

Re: how to write a tutorial

2005-01-23 Thread alex23
Daniel Bickett wrote: > You guys are just begging for a YHBT ;-) Point taken :) I've noticed very few people even acknowledge his posts at all; I'll follow the group lead and do the same. Cheers! - alex23 -- http://mail.python.org/mailman/listinfo/python-list

Re: Asynchronous event handling...?

2005-01-23 Thread Fredrik Lundh
Chris Line wrote: > When the 'stop' button is selected after 'count', it does > not execute until the count command finishes at 500. > Instead, it is desired to stop counting immediately and > execute the 'stop' method. > > Is there a simple way to handle this situation? calling self.update() at

Re: specifying constants for a function (WAS: generator expressions: performance anomaly?)

2005-01-23 Thread Bengt Richter
On Sun, 23 Jan 2005 13:14:10 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> On Sat, 22 Jan 2005 16:22:33 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote: >> >> [Steven Bethard] > If you really want locals that don't contribute to arguments, I'd be > much happie

Re: specifying constants for a function (WAS: generator expressions: performance anomaly?)

2005-01-23 Thread Steven Bethard
Bengt Richter wrote: So, e.g., for >>> presets = dict(a=1, b=2, deftime=__import__('time').ctime()) in the decorator args, the next version will act as if the decorated function had the source code >>> print '%s = __frompresets__' % ', '.join(sorted(presets)) a, b, deftime = __frompresets__ for

<    1   2