Re: Fuzzy matching of postal addresses

2005-01-19 Thread Aaron Bingham
Andrew McLean wrote: Thanks for all the suggestions. There were some really useful pointers. A few random points: [snip] 4. You need to be careful doing an endswith search. It was actually my first approach to the house name issue. The problem is you end up matching "12 Acacia Avenue, ..." with "

MDaemon Warning - virus found: Delivery reports about your e-mail

2005-01-19 Thread Mail Administrator
*** WARNING ** Este mensaje ha sido analizado por MDaemon AntiVirus y ha encontrado un fichero anexo(s) infectado(s). Por favor revise el reporte de abajo. AttachmentVirus name Action taken ---

RE: Print to Windows default Printer

2005-01-19 Thread Tim Golden
[Samantha] | I am new to Python and I am having considerable trouble | trying to print | (using a simple script) to the default printer rather than the screen. | Thanks for any help. | S It may be that something here will help you: http://tgolden.sc.sabren.com/python/win32_how_do_i/print.html

RE: Solutions for data storage?

2005-01-19 Thread Robert Brewer
Leif K-Brooks wrote: > My ideal solution would be an object database (or object-relational > mapper, I guess) which provided total transparency in all but a few > places, built-in indexing, built-in features for handling schema > changes, the ability to create attributes which are required to be

problem with import pylab from a website

2005-01-19 Thread jean . rossier
Hello All, I am facing a problem while importing pylab library(in a .py program file) via web browser however the same program works when I execute it from the command prompt. my configuration : Fedora Core 3 Apache 2.0 python 2.3.4 postgresql 7.3.4 mod_python-3.1.3-5 Error message we get: [W

Dictionary keys (again) (was Re: lambda)

2005-01-19 Thread Nick Coghlan
Antoon Pardon wrote: A rule of thumb is context sensitive. If circumstances change, so do the rules of thumb. Principles have a broader field of application. IMO there is nothing principally wrong with using a mutable object as a dictionary key. But avoiding doing so is a good rule of thumb if you

python & iges (nurbs file format)

2005-01-19 Thread Jelle Feringa // EZCT / Paris
Is anyone aware of a module allowing you to read / write .iges data? Currently I’m trying to figure a way of writing out my nurbs data generated in python, but if such a package exists, that would be great, haven’t been able to find anything so far…   Cheers,   Jelle. -- http://

Re: lambda

2005-01-19 Thread Antoon Pardon
Op 2005-01-18, David Bolen schreef <[EMAIL PROTECTED]>: > Antoon Pardon <[EMAIL PROTECTED]> writes: > >> Op 2005-01-18, Simon Brunning schreef <[EMAIL PROTECTED]>: >> > On 18 Jan 2005 07:51:00 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> >> 3 mutating an item in a sorted list *does* *always* ca

Re: Dictionary keys (again) (was Re: lambda)

2005-01-19 Thread Just
In article <[EMAIL PROTECTED]>, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: > > A rule of thumb is context sensitive. If circumstances change, > > so do the rules of thumb. Principles have a broader field > > of application. > > > > IMO there is nothing principally wrong with

Re: extension module, thread safety?

2005-01-19 Thread Pierre Barbier de Reuille
David Bolen a écrit : Nick Coghlan <[EMAIL PROTECTED]> writes: And even before that it was certainly possible to call into the Python interpreter from a native thread using existing functions, albeit the newer functions are more convenient (and perhaps more robust, I don't know). My earliest intera

Re: safest way to kill a thread

2005-01-19 Thread martinnitram
Great thank for your helping. Should the 'daemonic' flag at setDaemon() function set to 1/TRUE or 0/FALSE to do such action? limodou wrote: >I think only those threads which invoked with setDaemon() method will >exit, and others will not, as the main program exit. -- http://mail.python.org/mail

Re: lambda

2005-01-19 Thread Antoon Pardon
Op 2005-01-18, Bengt Richter schreef <[EMAIL PROTECTED]>: > On 18 Jan 2005 13:28:00 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >>I have implemented a hash table when I was a student and its >>implementation allowed the use of 'mutable' objects as a key >>without a problem. It simply always mad

Re: File objects? - under the hood question

2005-01-19 Thread Jeremy Bowers
On Tue, 18 Jan 2005 22:53:10 -0800, Eric Pederson wrote: > Perhaps I've answered my question and the under-the-hood mechanics are > handled on the OS side, and Python is just making requests of the OS... Almost by definition, the only correct way to read a file is to use the file system, which on

Re: python/cgi/html bug

2005-01-19 Thread Dfenestr8
On Tue, 18 Jan 2005 21:50:58 -0800, Dan Bishop wrote: > > Dfenestr8 wrote: >> Hi. >> >> I've written a cgi messageboard script in python, for an irc chan I > happen >> to frequent. >> >> Bear with me, it's hard for me to describe what the bug is. So I've >> divided this post into two sections: HO

Re: generator expressions: performance anomaly?

2005-01-19 Thread Steven Bethard
Stephen Thorne wrote: On Tue, 18 Jan 2005 23:09:57 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: @with_consts(i=1, deftime=time.ctime()) def foo(x, y=123, *args, **kw): return x*y, kw.get('which_time')=='now' and time.ctime() or deftime Then you don't have to mix parameter declarations with

IronPython, Boo and ASP.NET (web service)

2005-01-19 Thread JZ
Is there any way for preparing a simple web service (ASP.NET) using IronPython or Boo (http://boo.codehaus.org/)? I cannot find any example. C# uses [WebMethod] attribute for marking remote methods. I do not know how IronPython or Boo deals with it. -- JZ ICQ:6712522 http://zabiello.com -- http:

Re: generator expressions: performance anomaly?

2005-01-19 Thread Antoon Pardon
Op 2005-01-18, Jeremy Bowers schreef <[EMAIL PROTECTED]>: > On Tue, 18 Jan 2005 14:05:15 +, Antoon Pardon wrote: >> I don't see how generating byte code for a = 9; when seeing the >> expression a = 3 + 6, would be a problem for non-functional >> languages. > > To answer nearly every post you've

Re: lambda

2005-01-19 Thread Nick Coghlan
Antoon Pardon wrote: > I can be wrong, but until now I have seen no indication that I was using mutable and immutable differently than other people. AFAICT we all refer to whether an object belongs to a mutable or immutable class. The difference is that when you take a copy of the key and s

Re: generator expressions: performance anomaly?

2005-01-19 Thread Antoon Pardon
Op 2005-01-18, Steve Holden schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> Op 2005-01-18, Steve Holden schreef <[EMAIL PROTECTED]>: >> >> >>>Python is *designed* as a dynamic language. I wish you would embrace >>>this aspect rather than continually trying to shoehorn it into a static

Re: rotor replacement

2005-01-19 Thread Gerd Woetzel
Robin Becker <[EMAIL PROTECTED]> writes: >Paul Rubin wrote: >.I'm also missing the rotor module and regret that something useful >was warned about and now removed with no plugin replacement. Hm, yes. Here is a (rather slow) replacement: """This module is derived from Modules/rotormodule.c and

Re: rotor replacement

2005-01-19 Thread Robin Becker
Paul Rubin wrote: "Reed L. O'Brien" <[EMAIL PROTECTED]> writes: I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption? If you mean a module in the distribut

delay and force in Python

2005-01-19 Thread Will Stuyvesant
Here is a question for people who are more comfortable than I am with new Python stuff like generators. I am having fun implementing things from the Wizard book (Abelson, Sussman, "Structure and Interpretation of Computer Programs") in Python. In chapter 3.5 it is about streams as delayed lists.

Re: delay and force in Python

2005-01-19 Thread Benji York
Will Stuyvesant wrote: Streams are interesting because they are to lists like xrange is to range. Could save a lot on memory and computations. I think you're looking for generators. Below is my straight translation from Scheme code in the Wizard book to Python. Something else: this crashes with a

Re: delay and force in Python

2005-01-19 Thread Nick Coghlan
Will Stuyvesant wrote: The program below creates a stream with the numbers 1..995 and then filters the stream, keeping only the even numbers, and then prints the second number in the stream (implemented as the first number of the tail, just like in the 3.5 Section in the Wizard book). How's this: P

Re: rotor replacement

2005-01-19 Thread Paul Rubin
Robin Becker <[EMAIL PROTECTED]> writes: > What exactly are/were the political reasons for rotor removal? Some countries have laws about cryptography software (against some combination of export, import, or use). The Python maintainers didn't want to deal with imagined legal hassles that might de

Re: simultaneous multiple requests to very simple database

2005-01-19 Thread John Lenton
On Tue, Jan 18, 2005 at 11:26:46AM -0500, Eric S. Johansson wrote: > I have an application where I need a very simple database, effectively a > very large dictionary. The very large dictionary must be accessed from > multiple processes simultaneously. I need to be able to lock records > within

Re: rotor replacement

2005-01-19 Thread Nick Craig-Wood
Robin Becker <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > "Reed L. O'Brien" <[EMAIL PROTECTED]> writes: > > > >>I see rotor was removed for 2.4 and the docs say use an AES module > >>provided separately... Is there a standard module that works alike or > >>an AES module that works alike bu

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

2005-01-19 Thread David Fraser
Philippe C. Martin wrote: I actually target Unix and windows so pyexe won't cut it I'm afraid - same issue with Inno. As far as the site-package target, I don't fully understand your relunctancy. Just as my potential users might not own a compiler, they might not be computer proficient enough to ea

mod_python friendly isps in europe

2005-01-19 Thread paulo . jpinto
Hello everybody I'm thinking about improving my web site scripts and would like to use Python instead of PHP/Perl. Does anyone know of mod_python friendly ISPs in europe? With prices around 10€ ? Thanks in advance, Paulo -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython and PyGame - do they play well together?

2005-01-19 Thread Erik Bethke
After a touch more of exploration... actually from the wxPython demo's startup tips lead me over to the wxPython Wiki Here I found this gem: http://wiki.wxpython.org./index.cgi/IntegratingPyGame Awesome. There is in fact some very tricky timing of the import statement for pygame -Erik --

Re: Dictionary keys (again) (was Re: lambda)

2005-01-19 Thread Antoon Pardon
Op 2005-01-19, Nick Coghlan schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> A rule of thumb is context sensitive. If circumstances change, >> so do the rules of thumb. Principles have a broader field >> of application. >> >> IMO there is nothing principally wrong with using a mutable object

Automatic response to your mail (Error)

2005-01-19 Thread Webmaster
The automatic reply to this e-mail which you should have received in response to your e-mail to [EMAIL PROTECTED] has not been defined. Please contact [EMAIL PROTECTED] for assistance. -- http://mail.python.org/mailman/listinfo/python-list

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

2005-01-19 Thread Philippe C. Martin
Thanks David. Philippe >>Hi Philippe >>You may want to have a look at >>https://sourceforge.net/tracker/?func=detail&atid=305470&aid=793070&group_id=5470 >>This was originally a patch to distutils which enabled removing the >>source (i.e. only distributing compiled files). I have now attach

Re: generator expressions: performance anomaly?

2005-01-19 Thread Steve Holden
Paul Rubin wrote: Steve Holden <[EMAIL PROTECTED]> writes: You probably already know that sensible compiled language systems have used constant folding since time immemorial, but Python has always eschewed it. That's what comes of being a pragmatist's language: if such optimizations really are requ

Re: lambda

2005-01-19 Thread Antoon Pardon
Op 2005-01-19, Nick Coghlan schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > > I can be wrong, but until now I have seen no indication that I was >> using mutable and immutable differently than other people. AFAICT >> we all refer to whether an object belongs to a mutable or immutable >>

Re: safest way to kill a thread

2005-01-19 Thread hoxide
To Catch the "SystemExit" import thread from time import sleep import sys def t1(): try: i=0 while 1: print i+1 i += 1 sleep(1) except SystemExit: pass thread.start_new_thread(t1, ()) sleep(3) This Question was also asked in Python-chinese . -- http://mail.python.org/mailman/listinfo/python-

Zen of Python

2005-01-19 Thread Timothy Fitz
While I agree that the Zen of Python is an amazingly concise list of truisms, I do not see any meaning in: Flat is better than nested. I strive for balance between flat and nested. Does anyone have a good example of where this is applied? (specifically to python, or in general) -- http://mail.py

Accessing MDB files on Windows

2005-01-19 Thread Jorge Luiz Godoy Filho
Hi, What is the best way to deal with MDB files? I was thinking on using ODBC... I'll need to read and write some information to it. The load won't be so high, but there might be a lot of data. Any advices? Will my approach work? I'm not a Windows guy... :-) -- Godoy. <[EMAIL PROTEC

Automatic Windows printer creation?

2005-01-19 Thread GMane Python
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. Thanks! Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Zen of Python

2005-01-19 Thread Bill Mill
The example that occurs to me is that "import smtplib" is better than "import stdlib.inet.services.smtp". Peace Bill Mill bill.mill at gmail.com On Wed, 19 Jan 2005 14:13:47 -0500, Timothy Fitz <[EMAIL PROTECTED]> wrote: > While I agree that the Zen of Python is an amazingly concise list of > t

ElementTree cannot parse UTF-8 Unicode?

2005-01-19 Thread Erik Bethke
Hello All, I am getting an error of not well-formed at the beginning of the Korean text in the second example. I am doing something wrong with how I am encoding my Korean? Do I need more of a wrapper about it than simple quotes? Is there some sort of XML syntax for indicating a Unicode string,

Re: Zen of Python

2005-01-19 Thread Skip Montanaro
Bill> The example that occurs to me is that "import smtplib" is better Bill> than "import stdlib.inet.services.smtp". Sure. There is a balance to be achieved however. "import std.smtplib" might be better than "import smtplib", simply because making the standard library a package reduces

Re: Accessing MDB files on Windows

2005-01-19 Thread Jorge Luiz Godoy Filho
Larry Bates, Quarta 19 Janeiro 2005 14:01, wrote: > I'm assuming the application will be run on Windows. You're right. It will be run on Windows. I discarded some other platform due to the difficulty of supporting this file format. > You can use ODBC or DAO. > > An DAO solution that I wrote

Re: generator expressions: performance anomaly?

2005-01-19 Thread Steve Holden
Antoon Pardon wrote: Op 2005-01-18, Steve Holden schreef <[EMAIL PROTECTED]>: [...] But you do have a point that I have a tendency to put salt on any snail. I'll try to restrain myself a bit more in the future. Finally! :-) I find I like you much better after this reflective response. Thanks for t

a question

2005-01-19 Thread Nader Emami
L.S., I have a long command in Unix and I have to use os.system(cmd) statement. I do the following: cmd = '%s/mos user wmarch, cd /fa/wm/%s/%s, mkdir %s, put %s, chmod 644 %s' % (mosbin, jaar, filetype, filetype) status = os.system(cmd) This is not very clear, and I have to break this long

Re: Print to Windows default Printer

2005-01-19 Thread Samantha
Thanks Tim. I didn't realize it would be so difficult. S "Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RuntimeError: dictionary changed size during iteration

2005-01-19 Thread Roman Suzi
I think, the behaviour below is misfeature: >>> [e for e in vars()] Traceback (most recent call last): File "", line 1, in ? RuntimeError: dictionary changed size during iteration >>> e = None >>> [e for e in vars()] ['e', '__builtins__', 'rlcompleter', '__file__', '_[1]', 'atexit', '__name__',

Re: ElementTree cannot parse UTF-8 Unicode?

2005-01-19 Thread Fredrik Lundh
Erik Bethke wrote: > I am getting an error of not well-formed at the beginning of the Korean > text in the second example. I am doing something wrong with how I am > encoding my Korean? Do I need more of a wrapper about it than simple > quotes? Is there some sort of XML syntax for indicating a

Re: a question

2005-01-19 Thread Bill Mill
Nader, You've got a couple problems. First, you need to end the string before putting a continuation in. Secondly, you have 6 variables to be substituted and only provide 4. Here's some code, edited to show how to use continutations to join strings: >>> mosbin, jaar, filetype = (1,1,1) >>> cmd =

RE: a question

2005-01-19 Thread Sells, Fred
I would use something like cmd = '%s/mos user wmarch, ' % mosbin cmd += 'cd /fa/wm/%s/%s, ' % (jaar, filetype) cmd += ... which reveals that you don't have enough args to satisfy all the %s's -Original Message- From: Nader Emami [mailto:[EMAIL PROTECTED] --snip-- I have a long command in U

Re: RuntimeError: dictionary changed size during iteration

2005-01-19 Thread Jack Diederich
On Wed, Jan 19, 2005 at 11:45:15PM +0300, Roman Suzi wrote: > > I think, the behaviour below is misfeature: > > >>> [e for e in vars()] > Traceback (most recent call last): > File "", line 1, in ? > RuntimeError: dictionary changed size during iteration > >>> e = None > >>> [e for e in vars()]

Re: Has apparent 2.4b1 bug been fixed? flatten in Lib\compiler\ast.py overloads 'list' name

2005-01-19 Thread Larry Bates
You have name clashing between Python's built in list function and the variable called list that you pass into the function. Change the passed in variable name to something else. Larry Bates Try something like (not tested): def flatten(seq): l = [] for elt in seq: if isinstance(elt,

Re: a question

2005-01-19 Thread Fredrik Lundh
Bill Mill wrote: > You've got a couple problems. First, you need to end the string before > putting a continuation in. >>> "no\ ... pe" 'nope' >>> "however\ File "", line 1 "however\ ^ SyntaxError: EOL while scanning single-quoted string (in the second case, the ^ is trying t

Re: a question

2005-01-19 Thread Bill Mill
You are correct, sir. Didn't know you could do that. Neato. Peace Bill Mill bill.mill at gmail.com On Wed, 19 Jan 2005 22:10:05 +0100, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Bill Mill wrote: > > > You've got a couple problems. First, you need to end the string before > > putting a continuati

Re: Zen of Python

2005-01-19 Thread Mark McEahern
Timothy Fitz wrote: While I agree that the Zen of Python is an amazingly concise list of truisms, I do not see any meaning in: Flat is better than nested. I strive for balance between flat and nested. Does anyone have a good example of where this is applied? (specifically to python, or in general)

RE: Accessing MDB files on Windows

2005-01-19 Thread Robert Brewer
Jorge Luiz Godoy Filho wrote: > What is the best way to deal with MDB files? I was thinking on using > ODBC... I'll need to read and write some information to it. The load > won't be so high, but there might be a lot of data. > > Any advices? Will my approach work? I'm not a Windows guy... :

RE: RuntimeError: dictionary changed size during iteration

2005-01-19 Thread Robert Brewer
Roman Suzi wrote: > I think, the behaviour below is misfeature: > > >>> [e for e in vars()] > Traceback (most recent call last): > File "", line 1, in ? > RuntimeError: dictionary changed size during iteration > >>> e = None > >>> [e for e in vars()] > ['e', '__builtins__', 'rlcompleter', '__fil

Re: generator expressions: performance anomaly?

2005-01-19 Thread Antoon Pardon
Op 2005-01-19, Steve Holden schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> Op 2005-01-18, Steve Holden schreef <[EMAIL PROTECTED]>: > [...] >> >> But you do have a point that I have a tendency to put salt on >> any snail. I'll try to restrain myself a bit more in the future. >> > Finall

Re: simultaneous multiple requests to very simple database

2005-01-19 Thread Tim Jarman
Olaf Zetanien wrote: > > Use Firebird as sql backend. Is designed as you request (readers not lock > writers and writers not lock readers). Google for "firebird optimistic > lock". > > Off course, you have python driver: http://kinterbasdb.sf.net and can > deploy on windows and linux with a ver

Re: [OT] Good C++ book for a Python programmer

2005-01-19 Thread Philippe C. Martin
I suggest you google 'C++ tutorial' Regards, Philippe On Wed, 19 Jan 2005 04:08:16 -0800, [EMAIL PROTECTED] wrote: > I'm picking up C++ again after years of using almost nothing but > Python. I'm frankly enjoying the experience, and it's certainly > deepening my appreciation of Python (which

Re: [OT] Good C++ book for a Python programmer

2005-01-19 Thread John Hunter
> "Philippe" == Philippe C Martin <[EMAIL PROTECTED]> writes: Philippe> I suggest you google 'C++ tutorial' Regards, Stroustup's "The C++ Programming Language" is the best C++ book I've read. It is at a fairly high level, and I already had read several C++ books before reading it, so it

Re: delay and force in Python

2005-01-19 Thread Dave Benjamin
Will Stuyvesant wrote: . def delay(exp): return lambda: exp If you look at the definition of "delay" in SICP, you'll notice that it's defined as "syntax sugar", in other words, a macro. Since Python does not have macros, you'll have to just use "lambda", because by defining "delay" as a function

[ANN] XPN - X Python Newsreader 0.4.0 released

2005-01-19 Thread Nemesis
XPN is a multiplatform newsreader written in Python+GTK2. It is unicode compliant and has features like scoring/action rules, configurable attribution lines and random taglines, search facilities and filtered views, import/export newsrc ... You can find it on: http://xpn.altervista.org/index-en.h

Re: Accessing MDB files on Windows

2005-01-19 Thread Larry Bates
I'm assuming the application will be run on Windows. You can use ODBC or DAO. An DAO solution that I wrote (and use) can be found at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303349 For ODBC you would just use the standard library module. Larry Bates Syscon, Inc. Jorge Luiz Godoy Fil

Re: a question

2005-01-19 Thread Steve Holden
Nader Emami wrote: L.S., I have a long command in Unix and I have to use os.system(cmd) statement. I do the following: cmd = '%s/mos user wmarch, cd /fa/wm/%s/%s, mkdir %s, put %s, chmod 644 %s' % (mosbin, jaar, filetype, filetype) status = os.system(cmd) This is not very clear, and I have

Re: Solutions for data storage?

2005-01-19 Thread Pat
Leif K-Brooks wrote: > I'm writing a relatively simple multi-user public Web application with > Python. It's a rewrite of a similar application which used PHP+MySQL > (not particularly clean code, either). My opinions on various Web > frameworks tends to vary with the phase of the moon, but current

Re: python/cgi/html bug

2005-01-19 Thread Dfenestr8
On Wed, 19 Jan 2005 04:32:04 -0800, Fuzzyman wrote: > This looks very good. > I've been looking for a python messageboard CGI for a long time. > Thanx! No glaring security holes that you noticed? Other than being able to hide things in html tags? > If you wanted to add user accounts/login/admi

Re: Accessing MDB files on Windows

2005-01-19 Thread Jorge Luiz Godoy Filho
Steve Holden, Quarta 19 Janeiro 2005 14:38, wrote: > Note that DAO is a very old library, and nowadays ADO would probably be > the preferred method in the Windows environment (can DAO even *use* > oledb providers?). ADO libraries are available - see > >http://www.markcarter.me.uk/computing/py

Re: Accessing MDB files on Windows

2005-01-19 Thread Steve Holden
Jorge Luiz Godoy Filho wrote: Larry Bates, Quarta 19 Janeiro 2005 14:01, wrote: I'm assuming the application will be run on Windows. You're right. It will be run on Windows. I discarded some other platform due to the difficulty of supporting this file format. You can use ODBC or DAO. An DAO

Re: Solutions for data storage?

2005-01-19 Thread Pat
Posting using Google Groups messed up the formatting of those class definition examples. Assume that they contain the usual indentation of typical class definitions. ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: a question

2005-01-19 Thread Steve Holden
Will Stuyvesant wrote: Andrew Koenig wrote: how about writing this instead? ('this is a ' 'long string') Yes, nice. And to make that possible we have to write ('one-string-item',) instead of ('one-string-item') if we want a tuple with one string inside. Sometimes that feels like a wart to

Re: Accessing MDB files on Windows

2005-01-19 Thread Jorge Luiz Godoy Filho
Jorge Luiz Godoy Filho, Quarta 19 Janeiro 2005 14:25, wrote: > Thanks! I'm looking at it. Worked like a charm! And just now I noticed who's the author of the recipe ;-) Thanks! -- Godoy. <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Good C++ book for a Python programmer

2005-01-19 Thread beliavsky
Rick Muller wrote: >I was wondering whether anyone could recommend a good C++ book, with >"good" being defined from the perspective of a Python programmer. The STL and the template feature of C++ gives the programmer some of the functionality of Python (using templates instead of duck typing, vect

Re: [OT] Good C++ book for a Python programmer

2005-01-19 Thread Thomas Bartkus
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm picking up C++ again after years of using almost nothing but > Python. I'm frankly enjoying the experience, and it's certainly > deepening my appreciation of Python (which you can read however you > like). > Gad! After Python, how c

Re: simultaneous multiple requests to very simple database

2005-01-19 Thread Olaf Zetanien
On Tue, 18 Jan 2005 12:57:21 -0500, Eric S. Johansson <[EMAIL PROTECTED]> wrote: Robert Brewer wrote: Eric S. Johansson wrote: I have an application where I need a very simple database, effectively a very large dictionary. The very large dictionary must be accessed from multiple processes sim

Re: How to fill available screen size then scroll

2005-01-19 Thread Mudcat
bump -- http://mail.python.org/mailman/listinfo/python-list

Re: simultaneous multiple requests to very simple database

2005-01-19 Thread Jeremy Sanders
On Tue, 18 Jan 2005 11:26:46 -0500, Eric S. Johansson wrote: > So the solutions that come to mind are some form of dictionary in shared > memory with locking semaphore scoreboard or a multithreaded process > containing a single database (Python native dictionary, metakit, gdbm??) > and have all of

Re: Dictionary keys (again) (was Re: lambda)

2005-01-19 Thread Steven Bethard
David Eppstein wrote: In article <[EMAIL PROTECTED]>, Nick Coghlan <[EMAIL PROTECTED]> wrote: For a 'mutable key' to make sense, the following: lst = [] dct = {l: "Hi!"} print dct[[]] print dct[lst] lst.append(1) print dct[[1]] print dct[lst] Should print: Hi Hi Hi Hi Yes, and what should the fo

Re: a question

2005-01-19 Thread Andrew Koenig
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The error you get is NOT a syntax error: > > >>> cmd = '%s format %s \ > ... over %d lines' % ('my', 'string', 2) > >>> cmd > 'my format string over 2 lines' > >>> > > The interpreter is probably complaining because

Re: delay and force in Python

2005-01-19 Thread Will Stuyvesant
Yes you are right, if you just want to carry an expression around then lambda does it; but delay was not intended as a top-level function. Perhaps you think that my silly stream implementation in the original post builds the whole list, but it does not: >>> o = stream_enumerate_interval(11,121)

Re: [OT] Good C++ book for a Python programmer

2005-01-19 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I was wondering whether anyone could recommend a good C++ book, with > "good" being defined from the perspective of a Python programmer. I > realize that there isn't a book titled "C++ for Python Programmers", > but has anyone found one that they th

Re: Has apparent 2.4b1 bug been fixed? flatten in Lib\compiler\ast.py overloads 'list' name

2005-01-19 Thread Steve Holden
Larry Bates wrote: You have name clashing between Python's built in list function and the variable called list that you pass into the function. Change the passed in variable name to something else. I believe Bengt was merely seeking confirmation that this was indeed a bug in a distributed library

Re: generator expressions: performance anomaly?

2005-01-19 Thread Raymond Hettinger
[Steve Holden] > Since it doesn't yet optimize 2+5 to a constant-folded 7 you should > realize that you are suggesting a large increase in the compiler's > analytical powers. FWIW, limited constant folding is already in CVS for Py2.5. Raymond Hettinger -- http://mail.python.org/mailman/listi

Re: finding/replacing a long binary pattern in a .bin file

2005-01-19 Thread yaipa
Thanks Francois, It worked as expected. --- source_data = open("source_data.bin", 'rb').read() search_data = open("search_data.bin", 'rb').read() replace_data = open("replace_data.bin", 'rb').read() outFile = open("

Re: finding/replacing a long binary pattern in a .bin file

2005-01-19 Thread yaipa
Bengt, Thanks for the input, sorry, your diff threw me the first time I looked at it, but then I went back and tried it later. Yes it works fine and I've tucked it away for later use. For this particular Use Case String.replace seems to get the job done in short order and the tool needs to be ma

Re: Dictionary keys (again) (was Re: lambda)

2005-01-19 Thread Steven Bethard
Nick Coghlan wrote: For a 'mutable key' to make sense, the following: lst = [] dct = {l: "Hi!"} print dct[[]] print dct[lst] lst.append(1) print dct[[1]] print dct[lst] Should print: Hi Hi Hi Hi And here's an implementation that does so: py> class sillydict(dict): ... def __getitem__(self, key)

ANN: Free Trac/Subversion hosting at Python-Hosting.com

2005-01-19 Thread Remi Delon
Hello everyone, To celebrate its second anniversary, Python-Hosting.com is happy to announce that it is now offering free Trac/Subversion hosting. This offer is limited to open-source, python projects. Trac and Subversion make a great combination for project management. More information about Tra

Re: Zen of Python

2005-01-19 Thread Steve Holden
Peter Hansen wrote: Timothy Fitz wrote: While I agree that the Zen of Python is an amazingly concise list of truisms, I do not see any meaning in: Flat is better than nested. [incrdeibly secret PSU facts blurted out] And with that out of the way, one is left with "there's a balance along the flat/n

Re: finding/replacing a long binary pattern in a .bin file

2005-01-19 Thread yaipa
John, Thanks for reminding me of the mmap module. The following worked as expected. # import mmap source_data = open("source_file.bin", 'rb').read() search_data = open("search_data.bin", 'rb').read() replace_data = open("replace_data.bin",

Re: Accessing MDB files on Windows

2005-01-19 Thread Jorge Luiz Godoy Filho
Jorge Luiz Godoy Filho, Quarta 19 Janeiro 2005 15:17, wrote: > Hmmm... I see. I'm trying to avoid having to install external modules > at > my client's server. Should I use, given that both DAO and ODBC are > available with the win32all extensions, DAO or ODBC? > > Or would ADO give me so muc

Re: Dictionary keys (again) (was Re: lambda)

2005-01-19 Thread David Eppstein
In article <[EMAIL PROTECTED]>, Nick Coghlan <[EMAIL PROTECTED]> wrote: > For a 'mutable key' to make sense, the following: > > lst = [] > dct = {l: "Hi!"} > print dct[[]] > print dct[lst] > lst.append(1) > print dct[[1]] > print dct[lst] > > Should print: > Hi > Hi > Hi > Hi Yes, and what sho

Re: [OT] Good C++ book for a Python programmer

2005-01-19 Thread Andrew Koenig
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The 4th edition of the well-known "C++ Primer", with Moo as a new > co-author, will soon be published. It is a > more comprehensive and much longer book. It is also organized more traditionally than "Accelerated C++." "Accelerated C

FTPLIB & FTPS or SFTP?

2005-01-19 Thread Peter A.Schott
Does the ftplib support SFTP or FTPS? Is that part of a different module? We have a handful of partners who use FTPS or SFTP and I need to pull/push files to/from them. Thank you for all of your help. -Pete Schott -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Good C++ book for a Python programmer

2005-01-19 Thread Scott David Daniels
John Hunter wrote: "Philippe" == Philippe C Martin <[EMAIL PROTECTED]> writes: Philippe> I suggest you google 'C++ tutorial' Regards, Stroustup's "The C++ Programming Language" is the best C++ book I've read. It is at a fairly high level, and I already had read several C++ books before readin

Re: rotor replacement

2005-01-19 Thread Paul Rubin
Scott David Daniels <[EMAIL PROTECTED]> writes: > I understand this to be true. Since I am trying to address encryption > in the zipfile module, and I know you actually follow a bit of the > encryption stuff, can you answer a question or two for me? Sure, I can try, so go ahead. There's more cry

shelve to DB conversion?

2005-01-19 Thread Aahz
I'd like to hear some experiences about converting a shelf with pickles to database with pickles, particularly if someone has handy code for proxying shelve code. We're using PostgreSQL if that makes any difference. -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "1

xml parsing escape characters

2005-01-19 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I only know a little bit of xml and I'm trying to parse a xml document in order to save its elements in a file (dictionaries inside a list). When I access a url from python 2.3.3 running in Linux with the following lines: resposta = urllib.u

Re: delay and force in Python

2005-01-19 Thread infidel
It took me a while to figure out what the "translated" code was trying to do. Here's a quick example that I think accomplishes the same thing: >>> for i, n in enumerate(x for x in xrange(998) if x % 2 == 0): ... if i == 1: ... print n ... 2 -- http://mail.python.org

Re: python/cgi/html bug

2005-01-19 Thread Paul Rubin
Dfenestr8 <[EMAIL PROTECTED]> writes: > No glaring security holes that you noticed? Other than being able to hide > things in html tags? Looks like you can also embed arbitrary javascript (I just tried it). I haven't looked at the script itself yet. -- http://mail.python.org/mailman/listinfo/pyth

Re: a question

2005-01-19 Thread Will Stuyvesant
Andrew Koenig wrote: > how about writing this instead? > > ('this is a ' > 'long string') Yes, nice. And to make that possible we have to write ('one-string-item',) instead of ('one-string-item') if we want a tuple with one string inside. Sometimes that feels like a wart to me, but now

  1   2   >