Re: Fuzzy matching of postal addresses

2005-01-17 Thread John Machin
You can't even get anywhere near 100% accuracy when comparing "authoritative sources" e.g. postal authority and the body charged with maintaining a database of which streets are in which electoral district -- no, not AUS, but close :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Fuzzy matching of postal addresses

2005-01-17 Thread John Machin
Ermmm ... only remove "the" when you are sure it is a whole word. Even then it's a dodgy idea. In the first 1000 lines of the nearest address file I had to hand, I found these: Catherine, Matthew, Rotherwood, Weatherall, and "The Avenue". Ermmm... don't rip out commas (or other punctuation); repla

Re: extension module, thread safety?

2005-01-17 Thread Pierre Barbier de Reuille
David Bolen a écrit : If the threads under discussion are all Python threads, then by default yes, the extension module C functions will appear to be atomic from the perspective of the Python code. When the Python code calls into the extension module, the GIL (global interpreter lock) is still bei

Re: Problem parsing namespaces with xml.dom.minidom

2005-01-17 Thread Fredrik Lundh
Mike McGavin wrote: > I'm not terribly experienced with XML in general, so it's possible that I'm > just incorrectly > interpreting how things are supposed to work to begin with. If this is the > case, please accept my > apologies, but I'd like any suggestions for how I should be doing it. I

Re: how to find site-packages path (Michael Hoffman) - use distutils

2005-01-17 Thread vincent wehren
Philippe C. Martin wrote: The flawless way would be to use distutils. In fact you shouldn't even need your own install script--it should do most of the work for you. The reason I have not so far is I have not found a way to get what I want done: 1) create directories in site-packages (I gather thi

Re: python execution path

2005-01-17 Thread Peter Hansen
[EMAIL PROTECTED] wrote: Peter Hansen wrote: The best approach, if it's really intended to be a debugging aid, might be to learn about "pdb" This is more of a what if-ish question I guess. I use pdb fairly regularly, I'm just looking to extend my debugging toolkit. I saw an article recently

Re: python execution path

2005-01-17 Thread qhfgva
Peter Hansen wrote: > Dustin Lee wrote: > > I'm wondering if there is a way to get python to show each line as it > > is executed, sort of like sh -x does for shell programs. Seems like > > this would be a nice debugging aid. > > The best approach, if it's really intended to be a debugging > aid,

[perl-python] 20050118 keyed list

2005-01-17 Thread Xah Lee
© # -*- coding: utf-8 -*- © © # in Python, there's a special type of © # data structure called keyed list. it © # is a unordered list of pairs, each © # consists of a key and a value. It is © # also known as dictionary. © © # define a keyed list © aa = {'john':3, 'mary':4, 'jane':5, 'vicky':7} © p

Problem parsing namespaces with xml.dom.minidom

2005-01-17 Thread Mike McGavin
Hi everyone. I've been trying for several hours now to get minidom to parse namespaces properly from my stream of XML, so that I can use DOM methods such as getElementsByTagNameNS(). For some reason, though, it just doesn't seem to want to split the prefixes from the rest of the tags when pars

wxPython and PyGame - do they play well together?

2005-01-17 Thread Erik Bethke
Hello All, I am having a great time with python and pygame, and last night I took a long look at the wxPython demo. I think that rocks as well. So now, my question is do wxPython and PyGame work together? How is the windows event loop managed? How is the display window managed? Is it possible

Re: [perl-python] 20050117, filter, map

2005-01-17 Thread Tad McClellan
Erik Max Francis <[EMAIL PROTECTED]> wrote: > Steven Bethard wrote: > >> Is there any chance you could post these all as part of the same thread? >>That would be really nice for those of us who aren't interested -- >> then we could just ignore the thread... > > Or, better yet, not posting i

Re: [perl-python] 20050116 defining a function

2005-01-17 Thread Tad McClellan
Ala Qumsieh <[EMAIL PROTECTED]> wrote: > Xah Lee wrote: > *plonk* Man, you are way behind the curve. I did that over 3 years ago! [1] [1] Message-ID: <[EMAIL PROTECTED]> I followed the link in that post on a hunch, and found he says himself that he is a troll. Go figure... --

Re: dynamic data types

2005-01-17 Thread Steven Bethard
Paul Simmonds wrote: I would assume that they're refering to the fact that even the basic data types such as int are derived from object, and hence have methods: int.__class__.__base__ Java, for example, has both an Integer object and a basic int data type. One word. Yuck. Heh heh. Yeah, I can re

Re: strange note in fcntl docs

2005-01-17 Thread Skip Montanaro
John> And, even if they were, the note is *still* wrong and misleading: John> fcntl is available on Windows, and os.open's flags won't be. Does this read better? Skip -- *** /tmp/skip/ediffdJAG2X Mon Jan 17 21:53:05 2005 --- /Users/skip/src/python/head/dist/src/Doc/lib/lib

Re: Fuzzy matching of postal addresses

2005-01-17 Thread Skip Montanaro
Andrew> I'm 90% of the way there, in the sense that I have a simplistic Andrew> approach that matches 90% of the addresses in database A. But Andrew> the extra cases could be a pain to deal with! Based upon the examples you gave, here are a couple things you might try to reduce the si

Re: huygens lands on titan

2005-01-17 Thread Jon Perez
I sure as hell bet it didn't too. Fuzzyman wrote: John Thingstad wrote: -- huygens lands on titan Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ I bet it didn't... Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/p

Re: lambda

2005-01-17 Thread Craig Ringer
On Mon, 2005-01-17 at 12:15 -0300, John Lenton wrote: > knowledgeable and experienced users know when to ignore the rules. +1 QOTW One of the nice things is that Python permits you to do exactly that where appropriate while avoiding forcing you to do gruesome things to get a job done. I think t

Re: how to find site-packages path (Michael Hoffman) - use distutils

2005-01-17 Thread Philippe C. Martin
>>The flawless way would be to use distutils. In fact you shouldn't even >>need your own install script--it should do most of the work for you. The reason I have not so far is I have not found a way to get what I want done: 1) create directories in site-packages (I gather this shoudl be easy enou

DO YOU WANT $60,000? READ THIS!

2005-01-17 Thread kile
THE POWER OF $1 DOLLAR-SAFE AND FAST MONEY MAKING! I found this in a news group and decided to try it. A little while back, I was browsing through news groups, just like you are now and came across a message just like this, that said you could make thousands of dollars within weeks with only an in

Re: dynamic data types

2005-01-17 Thread Paul Simmonds
I would assume that they're refering to the fact that even the basic data types such as int are derived from object, and hence have methods: >>> int.__class__.__base__ Java, for example, has both an Integer object and a basic int data type. One word. Yuck. Paul S. -- http://mail.python.org/mai

Re: Fuzzy matching of postal addresses

2005-01-17 Thread John Roth
"Andrew McLean" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I have a problem that is suspect isn't unusual and I'm looking to see if there is any code available to help. I've Googled without success. There isn't any publically availible code that I'm aware of. Companies that do a

Re: Fuzzy matching of postal addresses

2005-01-17 Thread Tim Churches
Andrew McLean <[EMAIL PROTECTED]> wrote: > I have a problem that is suspect isn't unusual and I'm looking to > see if there is any code available to help. I've Googled without success. > > Basically, I have two databases containing lists of postal addresses and > need to look for matching addres

Re: [perl-python] 20050117, filter, map

2005-01-17 Thread Jürgen Exner
Abigail wrote: > Steven Bethard ([EMAIL PROTECTED]) wrote on CLVII September > $$ Is there any chance you could post these all as part of the same > thread? > > Just killfile him, and stop replying. Remember, don't feed the trolls. True, except that he spreads lies about Perl and really bad c

Re: Fuzzy matching of postal addresses

2005-01-17 Thread Jeff Shannon
Andrew McLean wrote: The problem is looking for good matches. I currently normalise the addresses to ignore some irrelevant issues like case and punctuation, but there are other issues. I'd do a bit more extensive normalization. First, strip off the city through postal code (e.g. 'Beaminster,

Re: Fuzzy matching of postal addresses

2005-01-17 Thread James Keasley
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2005-01-18, Andrew McLean <[EMAIL PROTECTED]> wrote: > I have a problem that is suspect isn't unusual and I'm looking to see if > there is any code available to help. I've Googled without success. I have done something very similar (well, near as

Re: python execution path

2005-01-17 Thread Peter Hansen
Dustin Lee wrote: I'm wondering if there is a way to get python to show each line as it is executed, sort of like sh -x does for shell programs. Seems like this would be a nice debugging aid. The best approach, if it's really intended to be a debugging aid, might be to learn about "pdb", starting

Re: dynamic data types

2005-01-17 Thread Peter Hansen
Charlie wrote: The description of Python always mentions "very high level dynamic data types". Now, I can't seem to find any examples of these (nothing described with this term anyway). Is this simply refering to built-in dynamic data structures such as lists and dictionaries, with a great deal of

Fuzzy matching of postal addresses

2005-01-17 Thread Andrew McLean
I have a problem that is suspect isn't unusual and I'm looking to see if there is any code available to help. I've Googled without success. 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

Re: PUG in Melbourne Australia?

2005-01-17 Thread Will
Hi , On Mon, 17 Jan 2005 14:50:34 GMT, Emiliano Molina <[EMAIL PROTECTED]> wrote: > Does anyone here know if there is a Python Users Group in Melbourne > Australia? I'm from NZ, but the closest thing to what you're after that I know of is over at Ozzope - Zope in Australia (Zope being built in P

Re: how to find site-packages path

2005-01-17 Thread Michael Hoffman
Philippe C. Martin wrote: I am using my own install script for my software and am looking for a flawless way to figure out where python, and more specifically site-packages is installed. The flawless way would be to use distutils. In fact you shouldn't even need your own install script--it should d

Re: Assigning to self

2005-01-17 Thread John Roth
"Frans Englich" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Monday 17 January 2005 20:03, John Roth wrote: "Frans Englich" <[EMAIL PROTECTED]> wrote in message In other words, you're trying to create a singleton. In general, singletons are frowned on these days for a number of

Dr. Dobb's Python-URL! - weekly Python news and links (Jan 15)

2005-01-17 Thread Cameron Laird
QOTW: "Python: it tastes so good it makes you hungrier." -- EP "I don't consider 'throws Exception' to be sloppy, I consider it to be programmers voting with their feet." -- Roy Smith The Centre for Epidemiology and Research has released a high-quality suite of Python-based "Network-en

Re: Integration with java (Jpype vs. JPE)

2005-01-17 Thread Steve Menard
Istvan Albert wrote: Cameron Laird wrote: Someone really ought to include a couple of sentences to that effect on the front page of http://jpype.sf.net/ >. Now I remember visiting this site, but never understood how it actually worked. Examples such as: from jpype import * startJVM("d:/tools/j2sdk

Re: Cygwin Popen object

2005-01-17 Thread Grover
Yup that fixed it, thanks a million :) -- http://mail.python.org/mailman/listinfo/python-list

pyMPI momory leak

2005-01-17 Thread Wen Jiang
Hi, I have been using pyMPI to parallelize my code and found that the function mpi.send() leaks memory a lot and thus is not really working for large amount fo data communication. It actually fails after the leak accumulates more than 2G. I wonder if others have the same experience or I did somethi

Re: extension module, thread safety?

2005-01-17 Thread David Bolen
Torsten Mohr <[EMAIL PROTECTED]> writes: > The question came up if this is by itself thread safe, > if some two or more threads try to change these data types, > are the C functions by themselves are "atomic" or can they > be interrupted be the perl interpreter and then (data types > are in some i

Re: Static executable with shared modules

2005-01-17 Thread "Martin v. Löwis"
Rickard Lind wrote: I'll be more specific: when I build python 2.3.4 on FreeBSD 4.9, the interpreter binary is linked against three shared libraries: libutil.so.3, libm.so.2 and libc_r.so.4. Now, these libraries are not present on the TARGET system (which is distinct from the build system, but bas

Re: news feed problem -- anyone else?

2005-01-17 Thread Tim Daneliuk
Bengt Richter wrote: I can see postings on google, but my news service is having a problem since sometime during the weekend. Can get old stuff from other n.g., but no new. Wondering whether I'll see this via google. Regards, Bengt Richter Bengt - I've had very good luck using the following *free*

buffered socket class

2005-01-17 Thread Dan Stromberg
I finally took a moment to put my buffered socket class, bufsock.py, on a web page. It's a wrapper class for python sockets. It should reduce tinygrams, as well as provide a more convenient interface to the application programmer. It includes functions for reading a certain number bytes, readin

Re: Assigning to self

2005-01-17 Thread Frans Englich
On Monday 17 January 2005 21:24, Peter Otten wrote: > Frans Englich wrote: > > On Monday 17 January 2005 20:03, John Roth wrote: > >> "Frans Englich" <[EMAIL PROTECTED]> wrote in message > > > > > > > >> In other words, you're trying to create a singleton. In general, > >> singletons are frowned o

Re: Assigning to self

2005-01-17 Thread Peter Otten
Frans Englich wrote: > On Monday 17 January 2005 20:03, John Roth wrote: >> "Frans Englich" <[EMAIL PROTECTED]> wrote in message > > > >> In other words, you're trying to create a singleton. In general, >> singletons are frowned on these days for a number of reasons, >> not least because of the

Re: Cygwin Popen object

2005-01-17 Thread Jason Tishler
On Mon, Jan 17, 2005 at 12:41:25PM -0800, christiancoder wrote: > Is anybody else getting the following error with the Popen object in > cygwin? The code works fine in windows and linux. > > File "d:\atg\personal\python\buildroot\util.py", line 100, in System > pipe = subprocess.Popen( command, sh

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread brucoder
Hi All, - Thanks, but it seems I may have been a bit more confused that even I thought. It turns out to be an issue with Apple's OS X pty/tty interface. Even though the mediator tool is set up to read in up to 20K of data, the pty interface blocks at 1024 bytes. When testing this under Linux, I'

Re: supplying constants in an extension module

2005-01-17 Thread Fredrik Lundh
Torsten Mohr wrote: > i write an extension module in C at the moment. > > I want to define some constants (integer mainly, > but maybe also some strings). > > How do i do that best within this extension module > in C? Do i supply them as RO attributes? > > What's the best way for it? reading the

Re: Scriptomatic 2.0

2005-01-17 Thread Brad Clements
If you stick an 's' into the URI, so it's https:// you'll get a certificate warning from FireFox. Looks like MS is running a self-signed certificate on www.microsoft.com weird. really -- Novell DeveloperNet Sysop #5 _ "Do Re Mi chel La Si Do" <[EMAIL PROTECTED]> wrote in message news:[EMAIL P

Re: Py_Object* Py_BuildValue, Py_INCREF necessary?

2005-01-17 Thread nszabolcs
no http://python.org/doc/2.4/api/refcountDetails.html nsz -- http://mail.python.org/mailman/listinfo/python-list

news feed problem -- anyone else?

2005-01-17 Thread Bengt Richter
I can see postings on google, but my news service is having a problem since sometime during the weekend. Can get old stuff from other n.g., but no new. Wondering whether I'll see this via google. Regards, Bengt Richter -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning to self

2005-01-17 Thread Peter Otten
Frans Englich wrote: >> > >>> class Foo(object): >> > >> > ... cache = {} >> > ... def __new__(cls, id): >> > ... try: >> > ... return cls.cache[id] >> > ... except KeyError: >> > ... pass >> > ... cls.cache[id] =

python execution path

2005-01-17 Thread Dustin Lee
I'm wondering if there is a way to get python to show each line as it is executed, sort of like sh -x does for shell programs. Seems like this would be a nice debugging aid. dustin -- http://mail.python.org/mailman/listinfo/python-list

Re: Py_Object* Py_BuildValue, Py_INCREF necessary?

2005-01-17 Thread Tim Peters
[Torsten Mohr] > when i write an extension module in C and return a Py_Object* > that i've built with Py_BuildValue, do i need to use Py_INCREF > on that before i return it to python from my extension module > or not? The docs for Py_BuildValue() say it returns a new reference (and it does). So t

extension module, thread safety?

2005-01-17 Thread Torsten Mohr
Hi, i write an extension module in C at the moment. This module does some work on some own data types that consist of some values. The functions that can change the data are written in C. The question came up if this is by itself thread safe, if some two or more threads try to change these data

supplying constants in an extension module

2005-01-17 Thread Torsten Mohr
Hi, i write an extension module in C at the moment. I want to define some constants (integer mainly, but maybe also some strings). How do i do that best within this extension module in C? Do i supply them as RO attributes? What's the best way for it? Thanks for hints, Torsten. -- http://ma

Py_Object* Py_BuildValue, Py_INCREF necessary?

2005-01-17 Thread Torsten Mohr
Hi, when i write an extension module in C and return a Py_Object* that i've built with Py_BuildValue, do i need to use Py_INCREF on that before i return it to python from my extension module or not? Thanks for hints, Torsten. -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning to self

2005-01-17 Thread Frans Englich
On Monday 17 January 2005 20:03, John Roth wrote: > "Frans Englich" <[EMAIL PROTECTED]> wrote in message > In other words, you're trying to create a singleton. In general, > singletons are frowned on these days for a number of reasons, > not least because of the difficulty of testing them. Then

Re: Assigning to self

2005-01-17 Thread Frans Englich
On Monday 17 January 2005 20:55, Frans Englich wrote: > On Monday 17 January 2005 19:02, Peter Otten wrote: > > Frans Englich wrote: > > > What the code attempts to do is implementing a, to the API user, > > > transparent memory-saver by ensuring that no more than one instance of > > > the class fo

Re: Excel module for Python

2005-01-17 Thread Stefan Eischet
Hi, I didn't catch older mails in this thread, so excuse me if this has already been pointed out: http://pyxlwriter.sourceforge.net/ "It's a port of John McNamara's Perl Spreadsheet::WriteExcel module" and it's really easy to use. I'm not sure if it does formulae, but it handles formatting fin

Cygwin Popen object

2005-01-17 Thread christiancoder
Is anybody else getting the following error with the Popen object in cygwin? The code works fine in windows and linux. File "d:\atg\personal\python\buildroot\util.py", line 100, in System pipe = subprocess.Popen( command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newl

Re: Assigning to self

2005-01-17 Thread Frans Englich
On Monday 17 January 2005 19:02, Peter Otten wrote: > Frans Englich wrote: > > What the code attempts to do is implementing a, to the API user, > > transparent memory-saver by ensuring that no more than one instance of > > the class foo exists for a particular id. E.g, the user can simply > > "crea

Re: [perl-python] 20050117, filter, map

2005-01-17 Thread Charlton Wilbur
> "SH" == Steve Holden <[EMAIL PROTECTED]> writes: SH> As I may have mentioned before, egotism can be the only SH> possible reason. Relevant links: "On Ignoring Trolls": http://www.xahlee.org/UnixResource_dir/writ/troll_ignorance.html "A Troll's Anthology": http://ww

Re: [perl-python] 20050117, filter, map

2005-01-17 Thread Abigail
Steven Bethard ([EMAIL PROTECTED]) wrote on CLVII September MCMXCIII in news:[EMAIL PROTECTED]>: $$ Xah Lee wrote: $$ > © Note: this post is from the Perl-Python $$ > © a-day mailing list at $$ > © http://groups.yahoo.com/group/perl-python/ $$ $$ Is there any chance you could post these all

Re: FTPLIB - retry files?

2005-01-17 Thread Mark McEahern
Peter A.Schott wrote: Is there any way to retry sending files with some delay up to a set number on failure? Sometimes we encounter a locked file on our server or the destination server and we want to retry that file in X seconds. In general, what's wrong with this: import time retryCount = 1

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread Fredrik Lundh
"brucoder" <[EMAIL PROTECTED]> wrote: > Currently, when sending a data stream that exceeds 1024 bytes via > stdin, the stream blocks at the 1024th byte. This precludes completion > of the submission of the data stream. you can pass in a buffer size when you open a file: >>> help(open)

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread Steve Holden
brucoder wrote: Currently, when sending a data stream that exceeds 1024 bytes via stdin, the stream blocks at the 1024th byte. This precludes completion of the submission of the data stream. But surely the blocking will only last as long as the consuming process leaves buffered input unread? reg

Re: hash patent by AltNet; Python is prior art?

2005-01-17 Thread more i squawed
Tim Churches a écrit : Provided other countries don't recognise software and business method patents, the litigation will be confined within US borders, where resources can be productivelt spent making television dramas about attractive young patent attorneys and plodding, tram-riding patent cl

Re: PyChecker messages

2005-01-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Ben Sizer <[EMAIL PROTECTED]> wrote: >But you could use a dict of return values, or even just assigning a >different return value in each if clause. The end result is that you >have a single well-defined exit point from the function, which is >generally considered to

FTPLIB - retry files?

2005-01-17 Thread Peter A.Schott
Is there any way to retry sending files with some delay up to a set number on failure? Sometimes we encounter a locked file on our server or the destination server and we want to retry that file in X seconds. Not exactly sure how to go about that right now short of moving the files elsewhere and

Re: Assigning to self

2005-01-17 Thread John Roth
"Frans Englich" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello, [...] What the code attempts to do is implementing a, to the API user, transparent memory-saver by ensuring that no more than one instance of the class foo exists for a particular id. E.g, the user can simply "crea

Re: python to mssql

2005-01-17 Thread Peter A.Schott
Brane, What are you wanting to know specifically? What is your client machine running? I've started using the Win32 modules to connect using ADODB and that works for me on Windows XP (hopefully 2003 as well, but not tested yet). I pulled those samples from someplace on the net using Goog

Re: protecting the python code.

2005-01-17 Thread A.B., Khalid
nell wrote: > Hi all, > I've developed a testing application in python, and should supply it in > a way that no one (lets say they are regular users) will understand it > and edit it. > The application source is all python but we expose a UI written in C# > that go over all our code and expose to u

Re: List problems in C code ported to Python

2005-01-17 Thread Grant Edwards
On 2005-01-17, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: l = [] for i in range(2): > for j in range(2): > l[i][j] = 'x' > > > > Traceback (most recent call last): > File "", line 3, in -toplevel- > l[i][j] = 'x' > IndexError: list index out of range > > So you still have to dimension t

Re: strange note in fcntl docs

2005-01-17 Thread John Lenton
On Mon, Jan 17, 2005 at 09:01:25AM -0600, Skip Montanaro wrote: > > I could have sworn that os.open supported the O_SHLOCK and O_EXLOCK flags. > I'm pretty sure I've used them in the past, but don't see them now. (They > aren't in 2.2 either.) > > If you try this: > > O_SHLOCK = 0x0010 >

Re: Embedding a restricted python interpreter

2005-01-17 Thread Dieter Maurer
Paul Rubin writes on 08 Jan 2005 14:56:43 -0800: > Dieter Maurer <[EMAIL PROTECTED]> writes: > > It uses a specialized compiler that prevents dangerous bytecode operations > > to be generated and enforces a restricted builtin environment. > > Does it stop the user fr

Re: Interpreter Not Initialized (version mismatch?)

2005-01-17 Thread Fredrik Lundh
Ryan Jud Hughes wrote: > I'm having trouble with python on MacOSX 10.3. I wrote an extension module, > in C, and got it to compile and run just fine, in MacOSX 10.2, using the > MacPython 2.3 package that I downloaded. > > But when I copied my stuff over to my computer that had MacOSX 10.3(.7), a

Interpreter Not Initialized (version mismatch?)

2005-01-17 Thread Ryan Jud Hughes
I'm having trouble with python on MacOSX 10.3. I wrote an extension module, in C, and got it to compile and run just fine, in MacOSX 10.2, using the MacPython 2.3 package that I downloaded. But when I copied my stuff over to my computer that had MacOSX 10.3(.7), and the out-of-the-box MacPython 2

Re: [perl-python] 20050116 defining a function

2005-01-17 Thread Chris Mattern
Xah Lee wrote: > errata: > > * the variables in the perl section should be declared inside the > subroutine. > * the @_[0] should've been $_[0] > > thanks for Dave Cross for pointing them out. > > * the Mathematica Apply should be Select... > Xah > [EMAIL PROTECTED] > http://xahlee.org/PageTw

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread brucoder
Currently, when sending a data stream that exceeds 1024 bytes via stdin, the stream blocks at the 1024th byte. This precludes completion of the submission of the data stream. Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread brucoder
Currently, when sending a data stream that exceeds 1024 bytes via stdin, the stream blocks at the 1024th byte. This precludes completion of the submission of the data stream. Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread Andrew Koenig
"brucoder" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Are there runtime settings that can be used to adjust the default 1024 > byte stdin buffer limit or a buildtime setting in pyconfig.h? I have a > need to pump this up to permit input of a large data block via stdin. What d

Re: Assigning to self

2005-01-17 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > An implementation of what you want can be found here: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558 > I think this recipe pre-dates the introduction of __new__ in Python. How about something like this (requires the nam

Re: How to prevent the script from stopping before it should

2005-01-17 Thread python
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > > #import urllib, sys > > #pages = ['http://www.python.org', 'http://xxx'] > > #for i in pages: > > # try: > > #u = urllib.urlopen(i) > > #print u.geturl() > > #except Exception, e: > > #print >> sys.stderr, '%s: %s'

Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread brucoder
Are there runtime settings that can be used to adjust the default 1024 byte stdin buffer limit or a buildtime setting in pyconfig.h? I have a need to pump this up to permit input of a large data block via stdin. Tim Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: How to prevent the script from stopping before it should

2005-01-17 Thread Fredrik Lundh
Steve Holden wrote: > You will need to import the socket module and then call > socket.setdefaulttimeout() to ensure that > communication with non-responsive servers results in a socket exception that > you can trap. or you can use asynchronous sockets, so your program can keep processing the

Re: Assigning to self

2005-01-17 Thread Reinhold Birkenfeld
Frans Englich wrote: > Hello, > > I am having trouble with throwing class instances around. Perhaps I'm > approaching my goals with the wrong solution, but here's nevertheless a > stripped down example which demonstrates my scenario: > > #

Re: Assigning to self

2005-01-17 Thread Peter Otten
Frans Englich wrote: > What the code attempts to do is implementing a, to the API user, > transparent memory-saver by ensuring that no more than one instance of the > class foo exists for a particular id. E.g, the user can simply "create" an > instance and if one not already exists, it is created.

Re: Assigning to self

2005-01-17 Thread Mark McEahern
Frans Englich wrote: Hello, I am having trouble with throwing class instances around. Perhaps I'm approaching my goals with the wrong solution, but here's nevertheless a stripped down example which demonstrates my scenario: [snip] The basic problem seems to be that you're trying to avoid creat

Re: Assigning to self

2005-01-17 Thread [EMAIL PROTECTED]
An implementation of what you want can be found here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558 -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning to self

2005-01-17 Thread Frans Englich
On Monday 17 January 2005 18:45, Frans Englich wrote: > The line 'self = me'(scary..) doesn't really > work for the attribute attr; the attribute exists on line 21, but it fails > when yo() tries to access it. Typo; line 21 is yo(). I ment line 18, the print statement in __init__. Cheers,

Assigning to self

2005-01-17 Thread Frans Englich
Hello, I am having trouble with throwing class instances around. Perhaps I'm approaching my goals with the wrong solution, but here's nevertheless a stripped down example which demonstrates my scenario: #--

Re: pychecker - sets.Set need to be overridden

2005-01-17 Thread Istvan Albert
Peter Otten wrote: The Set class has implementations for __cmp__() and __hash__() that unconditionally raise an exception. pychecker assumes that these methods are "abstract", i. e. meant to be overriden by a subclass, and warns that you are instantiating an abstract base class, while the intention

Re: Producer/consumer Queue "trick"

2005-01-17 Thread Evan Simpson
Nick Coghlan wrote: Paul Rubin wrote: That's weird. Preemption should happen every few dozen milliseconds unless you've purposely increased the preemption delay. To me, it smells like a call into a C extension which isn't releasing the GIL before starting a time-consuming operation. Sorry, I thi

Re: hash patent by AltNet; Python is prior art?

2005-01-17 Thread Jeff Shannon
Robert Kern wrote: I don't know the details [...] Neither do I, but... I'm also willing to bet that the patent won't hold up in court because there's quite a lot of prior art with respect to cryptographic hashes, too. The problem with that is that someone needs to be able to *afford* to challen

Re: PyChecker messages

2005-01-17 Thread John Roth
"Ben Sizer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] But you could use a dict of return values, or even just assigning a different return value in each if clause. The end result is that you have a single well-defined exit point from the function, which is generally considered to

Re: strange note in fcntl docs

2005-01-17 Thread Skip Montanaro
Skip> I could have sworn that os.open supported the O_SHLOCK and Skip> O_EXLOCK flags. I submitted a patch to posixmodule.c for these: http://python.org/sf/1103951 Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: How to prevent the script from stopping before it should

2005-01-17 Thread Steve Holden
[EMAIL PROTECTED] wrote: #import urllib, sys #pages = ['http://www.python.org', 'http://xxx'] #for i in pages: # try: #u = urllib.urlopen(i) #print u.geturl() #except Exception, e: #print >> sys.stderr, '%s: %s' % (e.__class__.__name__, e) will print an error if a page

Re: Producer/consumer Queue "trick"

2005-01-17 Thread Evan Simpson
Jon Perez wrote: If the consumer and the producer are separate threads, why does the consumer thread block when the producer thread is generating a new board? Or why does it take forever for the producer thread to be pre-empted? Also, I don't understand why the solution works. How does sleeping fo

Re: [perl-python] 20050117, filter, map

2005-01-17 Thread Xah Lee
erratum: the Mathematica Apply should've been Select. ... Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] 20050117, filter, map

2005-01-17 Thread Xah Lee
erratum: the Mathematica Apply should've been Select. ... Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Central New Jersey PIG Meeting -- Python Interest Group In Princeton PIG/IP

2005-01-17 Thread Jay Loden
Are visitors welcome? I just happen to be in NJ, and I would like to attend my first PIG/IP Also, are you related in any way to LUG/IP? -Jay On Monday 17 January 2005 10:36, [EMAIL PROTECTED] wrote: > Central New Jersey PIG Meeting -- Python Interest Group In Princeton > PIG/IP > > PIG/IP will

Re: how to find site-packages path

2005-01-17 Thread vincent wehren
Philippe C. Martin wrote: Hi, I am using my own install script for my software and am looking for a flawless way to figure out where python, and more specifically site-packages is installed. You can take a look at how this is done in Lib/site.py. Look for the bit of code that starts with prefixes =

Re: [perl-python] 20050116 defining a function

2005-01-17 Thread Xah Lee
errata: * the variables in the perl section should be declared inside the subroutine. * the @_[0] should've been $_[0] thanks for Dave Cross for pointing them out. * the Mathematica Apply should be Select... Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html -- http://mail.python.

  1   2   >