Re: atexit + threads = bug?

2006-01-12 Thread skip
David> atExitFunc is called when the main thread terminates, rather than David> when the process exits. The atexit documentation contains David> several warnings, but nothing about this. Is this a bug? This might be a bug, but I can't see how it can be in atexit. Atexit just regist

Re: Is 'everything' a refrence or isn't it?

2006-01-12 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > The reason is that I am still trying to figure out > what a value is myself. Do all objects have values? Yes. > If > not which do and which don't? What's the value of int(1)? > An object? Some otherwise unreachable thing that > represents the abstract concept of the

Re: flatten a level one list

2006-01-12 Thread bonono
David Murmann wrote: > Robin Becker schrieb: > > # New attempts: > > from itertools import imap > > def flatten4(x, y): > > '''D Murman''' > > l = [] > > list(imap(l.extend, izip(x, y))) > > return l > > > > > > from Tkinter import _flatten > > def flatten5(x, y): > > '''D Murm

Re: Why is there no post-pre increment operator in python

2006-01-12 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Anyone has any idea on why is there no post/pre increment operators in > python ? For lots of good reasons. > Although the statement: > ++j > works but does nothing So does --j. They both parse as a value with two unary operators applied to it in succession: +(+(j)

Re: Remote Function Call

2006-01-12 Thread Irmen de Jong
Mike wrote: > Hi, > > I have two machines. A python program on machine 1 needs to make a > python call to a method in machine 2. What is the most efficient / fast > / programmer friendly way to do it? > > - XML-RPC? > - Http Call? use Pyro http://pyro.sourceforge.net --Irmen -- http://mail.pyt

Re: time.strftime() NOT producing RFC2822-compliant Date strings?

2006-01-12 Thread Peter Hansen
richard wrote: > I'm just dealing with a Roundup bug report in which it's pointed out that > time.strftime() doesn't produce RFC2822-compliant date strings when in a > locale other than "C". While it doesn't fix strftime() (though a change to the docs might do that ), using email.Utils.formatdate

Creating shortcuts?

2006-01-12 Thread Ron Griswold
Hi Folks, Is it possible to create a shortcut to a file in Python? I need to do this in both win32 and OSX. I've already got it covered in Linux by system(ln...). Thanks, Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: flatten a level one list

2006-01-12 Thread Alex Martelli
Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Sion Arrowsmith <[EMAIL PROTECTED]> wrote: > > sum(...) > > sum(sequence, start=0) -> value > > > > If you're using sum() as a 1-level flatten you need to give it > > start=[]. > > Except if you are trying to sum arrays of strings... > > >>

HP open source printer drivers are in Python

2006-01-12 Thread Andy Leszczynski
I have a specific question, anybody is familiar? A. -- http://mail.python.org/mailman/listinfo/python-list

Re: another docs problem - imp

2006-01-12 Thread Steve Holden
[EMAIL PROTECTED] wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>[EMAIL PROTECTED] wrote: >> >> from the find_module documentation: find_module( name[, path]) [...] > > Reading more carefully is always useful. But that does

Re: Real-world use cases for map's None fill-in feature?

2006-01-12 Thread Raymond Hettinger
[Paul Rubin] > ISTR there's also a plan to eliminate map in Python 3.0 in favor of > list comprehensions. That would get rid of the possibility of using > map(None...) instead of izip_longest. This needs to be thought through. Not to fear. If map() eventually loses its built-in status, it will

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-12 Thread Raymond Hettinger
[EMAIL PROTECTED] > It's important that I can read the contents of the dict without > flagging it as modified, but I want it to set the flag the moment I add > a new element or alter an existing one (the values in the dict are > mutable), this is what makes it difficult. Because the values are > mu

Re: ajax python module??

2006-01-12 Thread Peter Hansen
Diez B. Roggisch wrote: > Mark Engstrom wrote: > > >>Does anyone have a recommendation on the best AJAX python module? > > > If it is the best is obviously an arguable assertion - but I very much like > MochiKit from Bob Ippolito. > > http://www.mochikit.org/ I heartily second the recommendat

Re: HP open source printer drivers are in Python

2006-01-12 Thread Ben Finney
Andy Leszczynski <[EMAIL PROTECTED]> writes: > I have a specific question, anybody is familiar? Only the omniscient, prescient or telepathic can be familiar with your question before you ask it. http://www.catb.org/~esr/faqs/smart-questions.html> -- \ "One of the most important thing

Re: More than you ever wanted to know about objects [was: Is everything a refrence or isn't it]

2006-01-12 Thread Bengt Richter
On Fri, 13 Jan 2006 03:12:00 +, Steve Holden <[EMAIL PROTECTED]> wrote: [...] >Note to nitpickers >-- >Please note that I *am* oversimplifying here, and the nitpickers will >undoubtedly find many threadsworth of valuable material here. The point >is to develop an understanding

Re: How to remove subset from a file efficiently?

2006-01-12 Thread Raymond Hettinger
AJL wrote: > How fast does this run? > > a = set(file('PSP320.dat')) > b = set(file('CBR319.dat')) > file('PSP-CBR.dat', 'w').writelines(a.difference(b)) Turning PSP into a set takes extra time, consumes unnecessary memory, eliminates duplicates (possibly a bad thing), and loses the origin

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-12 Thread Alex Martelli
Dave Hansen <[EMAIL PROTECTED]> wrote: ... > >Google also has technical offices in the New York area. > > City? . I moved out of the 'burbs of Minneapolis about 6 > years ago, not because of the weather, but because it was getting too > crowded for me. Yep, city -- specifically on Broadway,

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-12 Thread sandravandale
Thanks to everyone who posted comments or put some thought into this problem. I should have been more specific with what I want to do, from your comments the general case of this problem, while I hate to say impossible, is way more trouble than it's worth. By modified I meant that the dictionary

Re: Remote Function Call

2006-01-12 Thread Mike
Sounds like what I need. Thanks Irmen. I heard google uses python with multiple machines... how do they do it? Mike -- http://mail.python.org/mailman/listinfo/python-list

time.strftime() NOT producing RFC2822-compliant Date strings?

2006-01-12 Thread richard
I'm just dealing with a Roundup bug report in which it's pointed out that time.strftime() doesn't produce RFC2822-compliant date strings when in a locale other than "C". My reading of the RFC says that indeed the only valid strings should be the "C" locale strings: day-name= "Mon" /

Re: Conditionals stored as text to translate to real compares

2006-01-12 Thread Mike Meyer
"Randall Parker" <[EMAIL PROTECTED]> writes: > if OperatorType == ">": ># then do a greater than compare here. >BoolVal = TestVal > TargetVal > elif OperatorType == ">=": ># then do a greater or equal to here. >BoolVal = TestVal >= TargetVal > and so on. > > It would seem a lot eas

Re: atexit + threads = bug?

2006-01-12 Thread David Rushby
>> I would expect... > The relative order of "Main thread finished." and "T before > sleep" is purely due to timing accidents... Sure, I realize that the interactions between threads have no guaranteed order except what the programmer imposes upon them. I should have qualified my statement of exp

Re: Why is there no post-pre increment operator in python

2006-01-12 Thread Tim Peters
[EMAIL PROTECTED] > Anyone has any idea on why is there no post/pre increment operators in > python ? Maybe because Python doesn't aim at being a cryptic portable assembly language? That's my guess ;-) > Although the statement: > ++j > works but does nothing That depends on the type of j, and h

Re: Python and Solaris 10

2006-01-12 Thread Layne Meier
Thank you, thank you, thank you. This works so much better. Layne On Jan 12, 2006, at 2:24 PM, [EMAIL PROTECTED] wrote: > It looks like it is finding c++ in /usr/local/bin. Is that the compiler > you want to use? > > I was assuming you want to use the Sun provided GCC located in > /usr/sfw/bin

FW: Options enabled under optimization

2006-01-12 Thread Naveen H.S.
Hi I had mailed yesterday about the following topic to know the flags or options that are enabled when -O,-O2,-O3,-Os options are enabled. As mentioned below I was given this mail id to contact. So I am writing this mail with a lot of hopes. Ex Some flags that are enabled when -O is enabled is -

Re: Real-world use cases for map's None fill-in feature?

2006-01-12 Thread Raymond Hettinger
[Aahz] > I've counted 63 cases of ``map(None, ...`` in my company's code base. > You're probably right that most of them could/should use zip() instead; > I see at least a few cases of > > map(None, field_names, values) > > but it's not clear what the expectation is for the size of the two list

Re: time.strftime() NOT producing RFC2822-compliant Date strings?

2006-01-12 Thread richard
Peter Hansen wrote: > richard wrote: >> I'm just dealing with a Roundup bug report in which it's pointed out that >> time.strftime() doesn't produce RFC2822-compliant date strings when in a >> locale other than "C". > > While it doesn't fix strftime() (though a change to the docs might do > that )

Why is there no post-pre increment operator in python

2006-01-12 Thread riteshtijoriwala
Anyone has any idea on why is there no post/pre increment operators in python ? Although the statement: ++j works but does nothing -- http://mail.python.org/mailman/listinfo/python-list

Re: Spelling mistakes!

2006-01-12 Thread Terry Hancock
On Wed, 11 Jan 2006 06:57:06 + Steve Holden <[EMAIL PROTECTED]> wrote: > Terry Hancock wrote: > [...] > > > > The ideal of "don't repeat yourself" seems to get > > nudged out by "repeat yourself exactly once" when it's > > really important to get it right. ;-) > > > I suppose most readers are

Re: How to remove subset from a file efficiently?

2006-01-12 Thread Mike Meyer
"fynali" <[EMAIL PROTECTED]> writes: > Hi all, > > I have two files: Others have pointed out the Python solution - use a set instead of a list for membership testing. I want to point out a better Unix solution ('cause I probably wouldn't have written a Python program to do this): > Objective: to

Re: Is 'everything' a refrence or isn't it?

2006-01-12 Thread David Murmann
[EMAIL PROTECTED] schrieb: > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message >> *what* the value is is defined by the operations that the object supports >> (via its >> type). > > Well, that is already better than what is in the Lang Ref. > But there must be more to it than that. int(1) and

Re: Is 'everything' a refrence or isn't it?

2006-01-12 Thread rurpy
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: > > > > afaik, the Python Language Reference never defines the word "reference". > > > It carefully defines words like "object" and "value", though, and terms > > > like > > > "call by object" o

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-12 Thread Dave Hansen
On 12 Jan 2006 16:16:58 -0800 in comp.lang.python, [EMAIL PROTECTED] (Aahz) wrote: >In article <[EMAIL PROTECTED]>, >Dave Hansen <[EMAIL PROTECTED]> wrote: >> >>And, FWIW, I don't think I could convince my wife (or myself) to move >>to CullyFORNya for any amount of money, whether there was a mass

Re: ODBC Insert question

2006-01-12 Thread Steve Holden
Bill Witherspoon wrote: > Hi all, > > Am trying to teach myself a bit of Python by creating a small app to > track tasks, and docs associated with the task. I'm using Python 2.4 on > Win32 with an Access 2003 db which I'm attempting to talk to using > mxODBC. I can do Selects without difficulty

decode unicode string using 'unicode_escape' codecs

2006-01-12 Thread aurora
I have some unicode string with some characters encode using python notation like '\n' for LF. I need to convert that to the actual LF character. There is a 'unicode_escape' codec that seems to suit my purpose. >>> encoded = u'A\\nA' >>> decoded = encoded.decode('unicode_escape') >>> print len

Re: how do "real" python programmers work?

2006-01-12 Thread Martin v. Löwis
bblais wrote: > In Python, there seems to be a couple ways of doing things. I could > write it in one window, and from a Unix shell call >python myscript.py > and be like C++, but then I lose the interactiveness which makes > prototyping easier. If I use the python sh

ODBC Insert question

2006-01-12 Thread Bill Witherspoon
Hi all,Am trying to teach myself a bit of Python by creating a small app to track tasks, and docs associated with the task. I'm using Python 2.4 on Win32 with an Access 2003 db which I'm attempting to talk to using mxODBC. I can do Selects without difficulty but a simple Insert has me stumped for d

Re: void * C array to a Numpy array using Swig

2006-01-12 Thread Travis E. Oliphant
Philip Austin wrote: > "Travis E. Oliphant" <[EMAIL PROTECTED]> writes: > > >>Krish wrote: > > >>Yes, you are right that you need to use typemaps. It's been awhile >>since I did this kind of thing, but here are some pointers. > > > Also, there's http://geosci.uchicago.edu/csc/numptr > This

[ANN] XML Serializer module

2006-01-12 Thread Franck PEREZ
Dear all, I wished to announce here my first Python module : XML Serializer. It recursively serializes and deserializes Python objects and their children. Children may be an instance's attributes, or list/dict/tuple elements. When serializing an instance, you may customize the attributes which ar

Re: Help me in this please--is Python the answer?

2006-01-12 Thread Ray
Very useful input, Adrian. Thanks a lot! These are facts that I can use to convince people that Python is a legit choice for the app I'm developing. Warm regards, Ray Adrian Holovaty wrote: > Ray wrote: > > Yes, but this is more of a web application though--something that I've > > never develop

Re: how do "real" python programmers work?

2006-01-12 Thread sandravandale
I'm not an experienced python programmer, but I come from a C++ background as well. I like to code in Komodo ($29 for the personal edition) and that lets me have multiple python files opened in tabs, and multiple interpreters opened below, since the interpreter is command based, it doesn't have to

Re: Help with super()

2006-01-12 Thread Paul McNett
David Hirschfield wrote: > I tried that and super(B,self), but neither works. > > Using super(A,self) in the _getv(self) method doesn't work, since the > super() of A is "object" and that doesn't have the v property at all. > Not sure why you say that using self.__class__ is wrong as the first >

Re: Can't compile

2006-01-12 Thread Martin v. Löwis
Layne Meier wrote: > checking whether the C++ compiler works... configure: error: cannot run > C++ compiled programs. [...] > Any and all help would be greatly appreciated. Just pass "--without-cxx" to configure. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: help on eval()-like but return module object

2006-01-12 Thread Martin v. Löwis
Dody Suria Wijaya wrote: > Any helps on this topic would be highly appreciated. Thanks! You can use new.module to create a new module, and exec to execute some code in the module: py> m = new.module("Hallo") py> exec "a=3" in m.__dict__ py> m.a 3 py> m Regards, Martin -- http://mail.python.org

Re: Failing unittest Test cases

2006-01-12 Thread Scott David Daniels
OK I took the code I offered here (tweaked in reaction to some comments) and put up a recipe on the Python Cookbook. I'll allow a week or so for more comment, and then possibly pursue adding this to unittest. Here is where the recipe is, for those who want to comment further (in either that forum

Re: Help with super()

2006-01-12 Thread Paul McNett
David Hirschfield wrote: > Is there a way to get what I'm after using super()? Probably. > The idea is that I could have a chain of subclasses which only need to > redefine _v, and getting the value of v as a property would give me back > the full chain of _v values for that class and all its

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-12 Thread Steve Holden
Christian Tismer wrote: > Just to add a word that I forgot: > > Adhering to the subject line, the intent is to track modifications > of a dict. > By definition, modification of a member of a dict without replacing > the value is not considered a dict change. > Well, I agree. But I suppose much de

Re: Help with super()

2006-01-12 Thread David Hirschfield
Good point, I did notice that. My example is total junk, actually. Now that I look at it, it isn't at all possible to do what I'm after this way, since _getv() is never going to be looking at class A's _v value. So, the larger question is how to do anything that resembles what I want, which is

Re: different versions for 2.3.4 documentation

2006-01-12 Thread Martin v. Löwis
Manlio Perillo wrote: > I'm only a bit curious, but why documentation from > http://www.python.org/ftp/python/2.3.4/Python-2.3.4.tar.bz2 > and > http://www.python.org/ftp/python/doc/2.3.4/latex-2.3.4.tar.bz2 > differ? It appears that the latex-* set really comes from the 2.4 branch, somehow. That

Re: Real-world use cases for map's None fill-in feature?

2006-01-12 Thread Aahz
In article <[EMAIL PROTECTED]>, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > >Request for more information > >My request for readers of comp.lang.python is to search your own code >to see if map's None fill-in feature was ever used in real-world code >(not toy examples

Re: Freezing

2006-01-12 Thread Mike Meyer
Xavier Morel <[EMAIL PROTECTED]> writes: >[EMAIL PROTECTED] wrote: >> Dicts and sets require immutable keys, like tuples or frozensets, but >> to me they look like a duplication. So the idea is to remove tuples and >> frozensets (and replace the few other uses of tuples with lists, like >> the % in

Re: how do "real" python programmers work?

2006-01-12 Thread Dave Hansen
On 12 Jan 2006 12:20:50 -0800 in comp.lang.python, "bblais" <[EMAIL PROTECTED]> wrote: >Hello, > >Let me start by saying that I am coming from a background using Matlab >(or Octave), and C++. I am going to outline the basic nuts-and-bolts I generally write C code for embedded controllers. >of h

Re: void * C array to a Numpy array using Swig

2006-01-12 Thread Philip Austin
"Travis E. Oliphant" <[EMAIL PROTECTED]> writes: > Krish wrote: > Yes, you are right that you need to use typemaps. It's been awhile > since I did this kind of thing, but here are some pointers. Also, there's http://geosci.uchicago.edu/csc/numptr -- http://mail.python.org/mailman/listinfo/p

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-12 Thread Michael Spencer
[EMAIL PROTECTED] wrote: > It's important that I can read the contents of the dict without > flagging it as modified, but I want it to set the flag the moment I add > a new element or alter an existing one (the values in the dict are > mutable), this is what makes it difficult. Because the values a

Re: Converting a string to an array?

2006-01-12 Thread Xavier Morel
Tim Chase wrote: > The closest hack I could come up with was > > import random > s = "abcdefg" > a = [] > a.extend(s) > random.shuffle(a) > s = "".join(a) > > This lacks the beauty of most python code, and clearly feels like > there's somethign I'm missing. I

how do "real" python programmers work?

2006-01-12 Thread bblais
Hello, Let me start by saying that I am coming from a background using Matlab (or Octave), and C++. I am going to outline the basic nuts-and-bolts of how I work in these languages, and ask for some help to find out how the same thing is done in Python. I am not sure what the standard is. In C++

Re: Converting a string to an array?

2006-01-12 Thread Grant Edwards
On 2006-01-12, Ron Griswold <[EMAIL PROTECTED]> wrote: >> This lacks the beauty of most python code, and clearly feels like >> there's somethign I'm missing. Is there some method or function >> I've overlooked that would convert a string to an array with less >> song-and-dance? Thanks, > >>

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-12 Thread Christian Tismer
Steve Holden wrote: > [EMAIL PROTECTED] wrote: >> [EMAIL PROTECTED] wrote: >> >>> It's important that I can read the contents of the dict without >>> flagging it as modified, but I want it to set the flag the moment I add >>> a new element or alter an existing one (the values in the dict are >>> mu

Re: Freezing

2006-01-12 Thread Raymond Hettinger
[EMAIL PROTECTED] wrote: > add a freeze operation, to freeze lists, > sets and dicts (etc), so they can be used as keys. I'm curious whether you've had an actual use for dictionaries as keys. Likewise, how about frozensets? Have you had occasion to use them as keys? They were created to support

Re: Placing graphics & text on printed page - jan06call.jpg (0/1)

2006-01-12 Thread Roger Upole
Pywin32 wraps most of the GDI functions used to draw lines and text directly on a printer device context. Many of them are only implemented as methods of MFC objects rather than exposed directly. See \win32\Demos\print_desktop.py for some examples of working directly with a printer DC. hth

RE: Converting a string to an array?

2006-01-12 Thread Ron Griswold
Does this do what you are looking for? >>> s = 'abcdefg'; >>> a = []; >>> a += s; >>> a; ['a', 'b', 'c', 'd', 'e', 'f', 'g'] Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Chase Sent: Thursd

Re: Link List in Python

2006-01-12 Thread Mike Meyer
"sri2097" <[EMAIL PROTECTED]> writes: > Hi all, I have written a Link list implementation in Python (Although > it's not needed with Lists and Dictionaries present. I tried it just > for the kicks !). Anyway here is the code - Generally very nice. > # Creating a class comprising of node in Link L

Re: New Python.org website ?

2006-01-12 Thread Mike Meyer
Tim Parkin <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Of course, this is typical on the web: "Works in IE" really means >> "works in IE in the configurations we tested it for", and usually >> means "works in our favorite configuration". > Actually the site has been tested on every browser l

Re: python create mail

2006-01-12 Thread Tim Williams (gmail)
on 1/12/06, Tim Williams (gmail) < [EMAIL PROTECTED]> wrote: On 12 Jan 2006 04:28:44 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: hey I need help in sending email,It seems that while using  this set of commands from smtplib import SMTPs = SMTP()s.set_debuglevel(1)s.connect('outmail.hu

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-12 Thread Bengt Richter
On Thu, 12 Jan 2006 18:28:54 +, Steve Holden <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: >> [EMAIL PROTECTED] wrote: >> >>>It's important that I can read the contents of the dict without >>>flagging it as modified, but I want it to set the flag the moment I add >>>a new element or al

Re: File Navigation using python

2006-01-12 Thread Diez B. Roggisch
Danielsen Brian (IFR Contractor External) wrote: > Does anyone know how to do file navigation between drives? I know how to > navigate up and down within a drive (for example the C:\ drive), but I don't > know how to change drives. I'm looking for something like: > > os.chgdrv('d:\') os.chdir

Re: atexit + threads = bug?

2006-01-12 Thread Tim Peters
[David Rushby] > ... > I understand your explanation and can live with the consequences, but > the atexit docs sure don't prepare the reader for this. In fact, they don't mention threading.py at all. > They say, "Functions thus registered are automatically executed upon > normal interpreter termi

Re: how do "real" python programmers work?

2006-01-12 Thread [EMAIL PROTECTED]
bblais wrote: > In Python, there seems to be a couple ways of doing things. I could > write it in one window, and from a Unix shell call >python myscript.py > and be like C++, but then I lose the interactiveness which makes > prototyping easier. If I use the python sh

Re: Help me in this please--is Python the answer?

2006-01-12 Thread Aahz
In article <[EMAIL PROTECTED]>, Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote: > >- Do you have to interface with things like messaging-systems (a la JMS >specs), distributed transaction managers? If so, the only way to go >Python is Jython: Python for the JVM. Because AFAIK, there are no >interfa

Re: Where to report Python bug?

2006-01-12 Thread Aahz
In article <[EMAIL PROTECTED]>, puff <[EMAIL PROTECTED]> wrote: > >I'm very new to Python and have encountered what appears to be a bug >when using com automation of IE with events. I get exception messages >that look like this: > >pythoncom error: Python error invoking COM method. > >Where should

Re: build curiosities of svn head (on WinXP)

2006-01-12 Thread Paul Moore
On Mon, 09 Jan 2006 13:07:33 +0100, David Murmann <[EMAIL PROTECTED]> wrote: >Paul Moore schrieb: >>> btw, if anyone is interested in the (rather small) build-script for >>> nant, just ask, >> >> I haven't seen anyone ask, so can I? I'd love to see the build script. > >sorry it took me so long, i

Re: How to remove subset from a file efficiently?

2006-01-12 Thread AJL
On 12 Jan 2006 09:04:21 -0800 "fynali" <[EMAIL PROTECTED]> wrote: > Hi all, > > I have two files: > > - PSP320.dat (quite a large list of mobile numbers), > - CBR319.dat (a subset of the above, a list of barred bumbers) > ... > Objective: to remove the numbers present in barred-lis

atexit + threads = bug?

2006-01-12 Thread David Rushby
Consider the following program (underscores are used to force indentation): import atexit, threading, time def atExitFunc(): print 'atExitFunc called.' atexit.register(atExitFunc) class T(threading.Thread): def run(self): assert no

Re: How to remove subset from a file efficiently?

2006-01-12 Thread Fredrik Lundh
Steve Holden wrote: > > looks like premature non-optimization to me... > > > It might be quicker to establish a dict whose keys are the barred > numbers and use that, rather than a list, to determine whether the input > numbers should make it through. what do you think > barred = set(ope

Re: Freezing

2006-01-12 Thread bearophileHUGS
The first line of that example has to be: s = |set([1, 3, 5])| But I don't know/remember why set() can't accept many values like max/min: max([1,2,5]) max((1,2,5)) max(1,2,3) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Failing unittest Test cases

2006-01-12 Thread Bengt Richter
On Tue, 10 Jan 2006 11:13:20 +0100, Peter Otten <[EMAIL PROTECTED]> wrote: >Duncan Booth wrote: > >> Peter Otten wrote: >> >>> Marking a unittest as "should fail" in the test suite seems just wrong >>> to me, whatever the implementation details may be. If at all, I would >>> apply a "I know these

Re: atexit + threads = bug?

2006-01-12 Thread Tim Peters
[David Rushby] > Consider the following program (underscores are used to force > indentation): > > import atexit, threading, time > > def atExitFunc(): > print 'atExitFunc called.' > > atexit.register(atExitFunc) > > class T(threading.Thread): >

Re: Help me in this please--is Python the answer?

2006-01-12 Thread Adrian Holovaty
Ray wrote: > Yes, but this is more of a web application though--something that I've > never developed in Python before, so... I'll be evaluating Django > shortly--let me see how it compares to Tomcat. Performance is one of the key features of Django. For example, I'm using Django at washingtonpost

Re: Python and Solaris 10

2006-01-12 Thread Layne Meier
I get the same result. Layne On Jan 12, 2006, at 1:21 PM, [EMAIL PROTECTED] wrote: > I've built it with both GCC and Sun Studio compilers. > > Try adding /usr/sfw/bin to your path. > > Or set CC=/usr/sfw/bin/gcc > > casevh > > -- > http://mail.python.org/mailman/listinfo/python-list -- http:

Free Browser Automation tool PAMIE2b now available for download

2006-01-12 Thread [EMAIL PROTECTED]
The Free open-source Browser automation tool. cPAMIE.py The main python class that allows you to write scripts to automate the Internet Explorer browser client for function and unit testing. = PAMIE - Reference Guide - What's Ne

Re: Freezing

2006-01-12 Thread Xavier Morel
[EMAIL PROTECTED] wrote: > The first line of that example has to be: > > s = |set([1, 3, 5])| > > But I don't know/remember why set() can't accept many values like > max/min: > > max([1,2,5]) > max((1,2,5)) > max(1,2,3) > > Bye, > bearophile > How about just providing a freeze method on `obje

Re: batch tiff to jpeg conversion script

2006-01-12 Thread Martin Miller
[EMAIL PROTECTED] wrote: > Just curious... is PhotoShop _really_ recursive? We have dozens of > levels of sub-folders where the pics have been sorted and thousands of > pics. That's one reason I used os.walk() Yes, in the sense that there is an "Include All Subfolders" option for batch operation s

Re: Python and Solaris 10

2006-01-12 Thread casevh
It looks like it is finding c++ in /usr/local/bin. Is that the compiler you want to use? I was assuming you want to use the Sun provided GCC located in /usr/sfw/bin. Try CC=/usr/sfw/bin/gcc CXX=/usr/sfw/bin/g++ ./configure casevh -- http://mail.python.org/mailman/listinfo/python-list

Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-12 Thread Alec Wysoker
Well, I found a solution to some of these problems. Perhaps this new solution, combined with the sleeping to allow virus-checker,file-indexer,etc. will fix the problem. I opened a file with shelve, and when adding a particular entry found it to be corrupt. On Windows, shelve uses bsddb.hashopen.

ANNOUNCE: OSCON 2006 (Python 14 Conference) Call for Proposals

2006-01-12 Thread Kevin Altis
OSCON 2006: Opening Innovation http://conferences.oreillynet.com/os2006/ Save the date for the 8th annual O'Reilly Open Source Convention, happening July 24-28, 2006 at the Oregon Convention Center in beautiful Portland, Oregon. Call For Participation -- Submit a proposal-f

Help with super()

2006-01-12 Thread David Hirschfield
I'm having trouble with the new descriptor-based mechanisms like super() and property() stemming, most likely, from my lack of knowledge about how they work. Here's an example that's giving me trouble, I know it won't work, but it illustrates what I want to do: class A(object): _v = [1,2,3

Re: How to remove subset from a file efficiently?

2006-01-12 Thread Steve Holden
Fredrik Lundh wrote: > "fynali" wrote: > > >>>Objective: to remove the numbers present in barred-list from the >>>PSPfile. >>> >>>$ ls -lh PSP320.dat CBR319.dat >>>... 56M Dec 28 19:41 PSP320.dat >>>... 8.6M Dec 28 19:40 CBR319.dat >>> >>> $ wc -l PSP320.dat CBR

Freezing

2006-01-12 Thread bearophileHUGS
Most of my ideas seem usless or stupid, but I think expressing them here doesn't harm much. This is an idea for Py 3.0, because it's not backward compatible. Dicts and sets require immutable keys, like tuples or frozensets, but to me they look like a duplication. So the idea is to remove tuples an

Re: Placing graphics & text on printed page - jan06call.jpg (0/1)

2006-01-12 Thread Manlio Perillo
Michael Galvin ha scritto: > I am trying to use Python to send to the printer a calender filled > with a mix of text and simple graphics. I want to draw on the printed > page something like a table with 6 rows and 7 columns to represent a > calendar. I want to place text precisely within those bo

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-12 Thread Steve Holden
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > >>It's important that I can read the contents of the dict without >>flagging it as modified, but I want it to set the flag the moment I add >>a new element or alter an existing one (the values in the dict are >>mutable), this is what makes it d

Re: Python and Solaris 10

2006-01-12 Thread casevh
I've built it with both GCC and Sun Studio compilers. Try adding /usr/sfw/bin to your path. Or set CC=/usr/sfw/bin/gcc casevh -- http://mail.python.org/mailman/listinfo/python-list

Re: Placing graphics & text on printed page - jan06call.jpg (0/1)

2006-01-12 Thread Steve Holden
Michael Galvin wrote: > To see an example of what I am trying to accomplish, look at this page > on my personal website: > > http://mysite.verizon.net/michaelgalvin/jan06call.html > > I now realize my attachement could not be posted on this usenet group. > I suspect your best option would be to

Re: flatten a level one list

2006-01-12 Thread Michael Spencer
Peter Otten wrote: > I you require len(xdata) == len(ydata) there's an easy way to move the loop > into C: > > def flatten7(): > n = len(xdata) > assert len(ydata) == n > result = [None] * (2*n) > result[::2] = xdata > result[1::2] = ydata > return result > > $ python -m

Re: Placing graphics & text on printed page - jan06call.jpg (0/1)

2006-01-12 Thread Michael Galvin
To see an example of what I am trying to accomplish, look at this page on my personal website: http://mysite.verizon.net/michaelgalvin/jan06call.html I now realize my attachement could not be posted on this usenet group. On Thu, 12 Jan 2006 12:16:02 -0500, Michael Galvin <[EMAIL PROTECTED]> wrot

Re: Widget that displays a directory tree?

2006-01-12 Thread Phil Thompson
On Thursday 12 January 2006 4:55 pm, Edward C. Jones wrote: > Do any of the Python GUIs have a super-high-level widget that displays a > directory tree? Most file managers or editors have this type of window. Below is the dirview.py example from the soon-to-be-released PyQt4. Snapshots are availa

Python and Solaris 10

2006-01-12 Thread Layne Meier
I'm having a bit of a problem trying to install Python on a Solaris 10 system. I didn't have this kind of problem when trying to install it on Solaris 8. Has anyone else experienced this problem? I've tried adding CC=gcc into the configure script, and have also tried running ./configure --wi

Re: Timeout at command prompt

2006-01-12 Thread Thierry Lam
I got the signal to work on linux with sys.stdin.readline() but the process timeout after x seconds even when I input something. Is there a way to close the signal after getting a correct input from the console window? Thanks Thierry -- http://mail.python.org/mailman/listinfo/python-list

Re: How to remove subset from a file efficiently?

2006-01-12 Thread Raymond Hettinger
[fynali] > I have two files: > > - PSP320.dat (quite a large list of mobile numbers), > - CBR319.dat (a subset of the above, a list of barred bumbers) # print all non-barred mobile phone numbers barred = set(open('CBR319.dat')) for num in open('PSP320.dat'): if num not in b

Re: How to remove subset from a file efficiently?

2006-01-12 Thread Fredrik Lundh
"fynali" wrote: > > Objective: to remove the numbers present in barred-list from the > > PSPfile. > > > > $ ls -lh PSP320.dat CBR319.dat > > ... 56M Dec 28 19:41 PSP320.dat > > ... 8.6M Dec 28 19:40 CBR319.dat > > > >$ wc -l PSP320.dat CBR319.dat > > 4

Re: How to remove subset from a file efficiently?

2006-01-12 Thread Tim Williams (gmail)
On 12/01/06, Tim Williams (gmail) <[EMAIL PROTECTED]> wrote: On 12 Jan 2006 09:04:21 -0800, fynali < [EMAIL PROTECTED]> wrote: Hi all,I have two files:  - PSP320.dat (quite a large list of mobile numbers),  - CBR319.dat (a subset of the above, a list of barred bumbers)# head PSP320

  1   2   3   >