Re: New versions breaking extensions, etc.

2004-12-14 Thread Robin Becker
Cameron Laird wrote: . . Part of the trick is that it demands deep understanding to detect the antisynergies that arise from the interac- tions of the DLL, registry, and filesystem schemes. I know it was only this year that I realized the whole installation-requires-reb

Re: Performance (pystone) of python 2.4 lower then python 2.3 ???

2004-12-14 Thread Mark Asbach
Hi Lucas, > On a dual Xeon 3.0 Ghz: [...] > Which shows a decrease in performance. Could this have anything to do with the > fact that is is a dual processor box? Maybe. But my 3Gh P4/HT is also detected as a dual processor machine (Kernel 2.6), so it might be a general problem with the Xeon?

RE: Python mascot proposal

2004-12-14 Thread Doran_Dermot
Here are my suggestions: 1. A "larch" (nice play on early Java) 2. Shoebox in middle o' road! (totally meaningless) 3. A Python sitting in a comfy chair (indicating ease-of-use) 4. A "larch" All very Pythonic and non-controversial (unless you're a member of the "Prevention of Cruelty to Shoeboxes

Re: do you master list comprehensions?

2004-12-14 Thread Timothy Babytch
Will Stuyvesant wrote: data = [['foo','bar','baz'],['my','your'],['holy','grail']] sum(data, []) ['foo', 'bar', 'baz', 'my', 'your', 'holy', 'grail'] The second parameter passed to sum is just to overrride default initial value "zero". -- Timothy Babytch -- http://mail.python.org/mailman/listinfo/p

Re: uptime for Win XP?

2004-12-14 Thread Andrey Ivanov
>> Writting this script was harder than I initially thought due to >> a lack of documentation for win32all. And I still don't know what >> that bizzare_int value stands for (an error/status code?). [Fredrik Lundh] > if I'm not mistaken, the corresponding Win32 function is called > PdhGetFormattedC

Re: from vb6 to Python

2004-12-14 Thread Martijn Faassen
Luis M. Gonzalez wrote: Martijn Faassen wrote: Unfortunately this is currently not near production use, and whether Microsoft is funding IronPython development is up in the air: It's true that he Ironpython's mailing list is a little bit innactive, but this is just because there's only one person

Re: Python mascot proposal

2004-12-14 Thread Keith Dart
Dimitri Tcaciuc wrote: Yup, I was aware of the fact of Monty Python roots of the language name. However, you will probably agree that a snake is more associative. Plus, if to use some characteristic MP feature like a giant foot, I'm not positive that it won't trigger any copyright issues. I pref

Re: gather information from various files efficiently

2004-12-14 Thread Fernando Perez
Keith Dart wrote: > Aye... > > the dict.keys() line creates a temporary list, and then the 'in' does a > linear search of the list. Better would be: > > try: > dict[a].append(b) > except KeyError: > dict[a] = [b] > > since you expect the key to be there most of the time, this method i

Re: PEP 338: Executing modules inside packages with '-m'

2004-12-14 Thread Just
In article <[EMAIL PROTECTED]>, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > Just wrote: > > > >> as for the rest of your arguments, I have to assume that you were joking. > >> (or > >> that you have no experience whatsoever of distribution of Python programs > >> in > >> Unix and Windows envi

Html or Pdf to Rtf (Linux) with Python

2004-12-14 Thread Alexander Straschil
Hello! I have to convert an HTML document to rtf with python, was just googling for an hour and did find nothing ;-( Has anybody an Idea how to convert (under Linux) an HTML or Pdf Document to Rtf? Thanks, AXEL -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are tuples immutable?

2004-12-14 Thread Gerrit
Another tuple/list question. Fredrik Lundh wrote: > http://www.python.org/doc/faq/general.html#why-are-there-separate-tuple-and-list-data-types Apart from historical, compatibility reasons, why is "foo %s bar %s" % [2, 4] illegal? I could imagine that anything accepting numerical values fo

Re: lies about OOP

2004-12-14 Thread Miki Tebeka
Hello projecktzero, > A co-worker considers himself "old school" in that he hasn't seen the > light of OOP.(It might be because he's in love with Perl...but that's > another story.) He thinks that OOP has more overhead and is slower than > programs written the procedural way. I poked around google

need some help quickly

2004-12-14 Thread Allan Irvine
HI Hope this is the right place for this, I am new. I have a spec to create a (dual screen) framework application that 1 displays mp3, flash, jpegs etc. on top screen 2: displays buttons on bottom screen which alter image when a key is pressed. The hardware is a dell pc basically, no mouse and t

PIL and format conversions -- Noobie.

2004-12-14 Thread Ron Phillips
I have a monster jpg (128 mb) that comprises a handful of colors (20 or so, max). It should never have been compressed with jpeg compression, as I understand it. It should have been a png or gif, since they are made to handle blocks of a few colors.   I used PIL to convert it to png and to gi

Re: from string to raw string

2004-12-14 Thread chris . lyon
Dan Perl wrote: > Yeah, you're right. I got it all twisted in my mind. It's late and I must > be getting tired. > Perl & Twisted in the same thread, that should fool the search engines :D -- http://mail.python.org/mailman/listinfo/python-list

Re: while 1 vs while True

2004-12-14 Thread Paul Rubin
Nick Coghlan <[EMAIL PROTECTED]> writes: > Until this code: > > .>>> import pdb > .>>> pdb.True = 0 > .>>> pdb.x = "Darn writeable module dictionaries" > .>>> from pdb import True > .>>> True > 0 > .>>> from pdb import x > .>>> x > 'Darn writeable module dictionaries' If Python really does behave

Re: lies about OOP

2004-12-14 Thread Peter Hansen
[EMAIL PROTECTED] wrote: I just can't see what can be done with OOP taht can't be done with standart procedural programing. Well, there's absolutely nothing you can do with OOP that can't be done with "standard procedural programming" (SPP). But that's hardly the point. After all, anything you ca

RE: Python mascot proposal

2004-12-14 Thread EP
[EMAIL PROTECTED] wrote: > > Here are my suggestions: ... > 4. A "larch" > ... > Anybody know what a larch looks like? > Right! Well, some rather good pictures of the Larch on this website (my, stunning, the larch looks, eh?!) http://www.neuroinformatik.ruhr-uni-bochum.de/PEOPLE/bolder/monty

Re: PIL and format conversions -- Noobie.

2004-12-14 Thread Fredrik Lundh
Ron Phillips wrote: >I have a monster jpg (128 mb) that comprises a handful of colors (20 or > so, max). It should never have been compressed with jpeg compression, as > I understand it. It should have been a png or gif, since they are made > to handle blocks of a few colors. if you compress an i

Re: Html or Pdf to Rtf (Linux) with Python

2004-12-14 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Alexander Straschil <[EMAIL PROTECTED]> wrote: >Hello! > >I have to convert an HTML document to rtf with python, was just googling >for an hour and did find nothing ;-( >Has anybody an Idea how to convert (under Linux) an HTML or Pdf Document >to Rtf? > >Thanks, AX

Re: [dictionary] how to get key by item

2004-12-14 Thread Skip Montanaro
Ola> If some keys has the same value as the item this will cause Ola> problems because keys in your result dictionary can be Ola> overwritten. That's why I said, "assuming your dictionary defines a one-to-one mapping...". Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: from string to raw string

2004-12-14 Thread TZOTZIOY
On 14 Dec 2004 05:11:07 -0800, rumours say that [EMAIL PROTECTED] might have written: >Dan Perl wrote: >> Yeah, you're right. I got it all twisted in my mind. It's late and >>I must be getting tired. >Perl & Twisted in the same thread, that should fool the search engines >:D Now, if only Sam R

Emailing in Python

2004-12-14 Thread Philippe Reynolds
Hi, I'm learning python...one of my tasks is to send out emails... I can send emails to one person at a time but not as groups Do you think you can help. Cheers Philippe Reynolds Here is the section of code: # me == the sender's email address me = '[EMAIL PROTECTED]' # you == the recipient's em

Re: Html or Pdf to Rtf (Linux) with Python

2004-12-14 Thread Axel Straschil
Hello! Sorry Cameron, I was replying, now my folloup ;-): > Are you trying to convert one document in particular, or automate the > process of conveting arbitrary HTML documents? I have an small CMS System where the customer has the posibility to view certain Html-Pages as Pdf, the CMS ist Pytho

Python 3.0

2004-12-14 Thread Chris
Okay, color me stupid, but what is everyone referencing when they mention Python 3.0? I didn't see any mention of it on the Python site. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess vs. proctools

2004-12-14 Thread Donn Cave
Keith Dart <[EMAIL PROTECTED]> wrote: |>> Oh, I forgot to mention that it also has a more user- and |>> programmer-friendly ExitStatus object that processess can return. This |>> is directly testable in Python: |>> |>> proc = proctools.spawn("somecommand") |>> exitstatus = proc.wait() |>> |>> if

RE: Python IDE

2004-12-14 Thread Doran_Dermot
If you want to spend the $35 I can recommend WingIDE. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Sent: 14 December 2004 16:37 To: [EMAIL PROTECTED] Subject: Python IDE What IDE's do y'all recommend for Python? I'm using PythonWin atm, but I'

pyparsing and 'keywords'

2004-12-14 Thread Berteun Damman
Hello, I'm having some problems with pyparsing, I could not find how to tell it to view certain words as keywords, i.e. not as a possible variable name (in an elegant way), for example, I have this little grammar: terminator = Literal(";") expr = Word(alphas) body = Forward(); ifstat = "if" + bod

ANN: Python Test Environment

2004-12-14 Thread Fuzzyman
Well sort of... More a request for comments really - to see if anyone is interested in this. http://www.voidspace.org.uk/atlantibots/pythonutils.html#testenv I've created a script that will build a 'test environment'. Windoze(tm) only as it uses py2exe. It scans your Python\Lib folder and b

Re: while 1 vs while True

2004-12-14 Thread Steve Holden
Peter Otten wrote: Fredrik Lundh wrote: Steve Holden wrote: It was unfortunate that so many people chose to use that for compatibility, when if they'd used the same code that the win32all extensions did they could have retained backward compatibility even across a change to constants: try: Tru

Re: how do I "peek" into the next line?

2004-12-14 Thread fuzzylollipop
read the orginal poster's SPECIFIC question he make only reference to a FILE or STDIN which can't be destructively read, either way he don't not requre the look-ahead to do what he wants. So my advice is still valid. Think about it in a different way. -- http://mail.python.org/mailman/listinfo/py

PythonWin Not Updating

2004-12-14 Thread Chris
I'm working on a program in PythonWin. The problem I'm running into is that after I make a code change, PythonWin doesn't always see it. Has anyone else had this problem? Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: RegEx: find all occurances of a single character in a string

2004-12-14 Thread Steven Bethard
Franz Steinhaeusler wrote: given a string: st="abcdatraataza" ^ ^ ^ ^ (these should be found) I want to get the positions of all single 'a' characters. (Without another 'a' neighbour) You could also try negative lookahead/lookbehind assertions: >>> st="abcdatraataza" >>> for m in re.findi

Re: RegEx: find all occurances of a single character in a string

2004-12-14 Thread P
[EMAIL PROTECTED] wrote: import re s='abcdatraataza' r=re.compile('(? Oops, tested this time: import re def index_letters(s,l): regexp='(? print index_letters('abcdatraataza','a') -- Pádraig Brady - http://www.pixelbeat.org -- -- http://mail.python.org/mailman/listi

RE: Python IDE

2004-12-14 Thread Batista, Facundo
Title: RE: Python IDE [Chris] #- -chuckle-  Hopefully I don't start off a full fledged war.-grin- Too late, :p #- Why didn't you like Eclipse?  Was it that the Python modules #- were bad, #- or just Eclipse in general?  I use it for my Java developement and #- haven't had any problem

Re: Emailing in Python

2004-12-14 Thread Larry Bates
Great class for making this very easy located here: http://motion.sourceforge.net/related/send_jpg.py And is supports list of binary attachments that is pretty tricky by hand. Larry Bates Syscon, Inc. Philippe Reynolds wrote: Hi, I'm learning python...one of my tasks is to send out emails... I can

Re: while 1 vs while True

2004-12-14 Thread Steven Bethard
Steve Holden wrote: # Pre 2.2.1 compat. try: True, False except NameError: True = 1==1; False = 1==0 I believe this should work for all versions up to 2.4, and would also work with a 2.5 that made True and False constants. But if anyone can prove me wrong it would be you ... :-) Seems like it mig

Re: RegEx: find all occurances of a single character in a string

2004-12-14 Thread P
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: import re s='abcdatraataza' r=re.compile('(? Oops, tested this time: import re def index_letters(s,l): regexp='(? print index_letters('abcdatraataza','a') Just comparing Fredrik Lundh's method: r=re.compile("a+") [m.

Re: Suggestion for "syntax error": ++i, --i

2004-12-14 Thread Doug Holton
Petr Prikryl wrote: Hi, Summary: In my opinion, the C-like prefix increment and decrement operators (++i and --i) should be marked as "syntax error". We have a patch for increment and decrement operators in boo ( http://boo.codehaus.org/ ), along with an operator overloading syntax like below. S

Re: gather information from various files efficiently

2004-12-14 Thread Jeff Shannon
Klaus Neuner wrote: Yet, I have got 43 such files. Together they are 4,1M large. In the future, they will probably become much larger. At the moment, the process takes several hours. As it is a process that I have to run very often, I would like it to be faster. Others have shown how you can m

Re: Python 3.0

2004-12-14 Thread Doug Holton
Chris wrote: Okay, color me stupid, but what is everyone referencing when they mention Python 3.0? I didn't see any mention of it on the Python site. http://www.python.org/moin/Python3.0 has more information than the PEP 3000, plus you can contribute to the page. -- http://mail.python.org/mailman

Re: pyparsing and 'keywords'

2004-12-14 Thread Paul McGuire
"Berteun Damman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 14 Dec 2004 18:39:19 GMT, Paul McGuire > <[EMAIL PROTECTED]> wrote: > >> If I try however to parse the String "if test; testagain; fi;", it does > >> not work, because the fi is interpreted as an expr, not as the

Re: Python IDE

2004-12-14 Thread Jarek Zgoda
Chris wrote: What IDE's do y'all recommend for Python? I'm using PythonWin atm, but I'd like something with more functionality. On Linux, Eric3 is really worth recommending. On Windows, if you don't mind spending some $$$, buy Komodo. These programs "have it all" (Eric3 "has more", though). --

Re: save an opengl canvas (wxPython)

2004-12-14 Thread Mike C. Fletcher
There's sample code in PyOpenGL and OpenGLContext for saving canvases to PNG or JPEG formats using PIL. Saving to Postscript requires considerably more work (if you're implying saving as triangles, lines and the like). There is a GPL library which lets you do this, and I have an old SWIG wrap

Re: PythonWin Not Updating

2004-12-14 Thread Greg Krohn
Robert Brewer wrote: Chris wrote: I'm working on a program in PythonWin. The problem I'm running into is that after I make a code change, PythonWin doesn't always see it. Has anyone else had this problem? "See it" in the interactive session? Use reload(): http://docs.python.org/lib/built-in-fun

Re: lies about OOP

2004-12-14 Thread Jarek Zgoda
projecktzero wrote: A co-worker considers himself "old school" in that he hasn't seen the light of OOP.(It might be because he's in love with Perl...but that's another story.) He thinks that OOP has more overhead and is slower than programs written the procedural way. I poked around google, but I d

Re: PEP 338: Executing modules inside packages with '-m'

2004-12-14 Thread Fredrik Lundh
Martin Bless wrote: > On my Windows machine this command line switch really makes my life so > much easier. if you use windows, chances are that what you really want is exemaker... -- http://mail.python.org/mailman/listinfo/python-list

How do I convert characters into integers?

2004-12-14 Thread Markus Zeindl
Hello, I want to write a simple encrypter, but I've got a problem: How can I convert characters into integers? I have got a string from the user, for example "Hi!". Now I get every character with a loop: buffer = "" for i in range(len(message)): ch = message[i-1:i] ... The character is saved

Re: lies about OOP

2004-12-14 Thread Terry Reedy
I did not really 'get' OOP until after learning Python. The relatively simple but powerful user class model made more sense to me than C++. So introducing someone to Python, where OOP is a choice, not a mandate, is how *I* would introduce a procedural programmer to the subject. YMMV. Terry

Re: How do I convert characters into integers?

2004-12-14 Thread Markus Zeindl
Grant Edwards wrote: On 2004-12-14, Markus Zeindl <[EMAIL PROTECTED]> wrote: I want to write a simple encrypter, but I've got a problem: How can I convert characters into integers? $ python Python 2.3.4 (#2, Aug 19 2004, 15:49:40) [GCC 3.4.1 (Mandrakelinux (Alpha 3.4.1-3mdk)] on linux2 Type "hel

Re: Automate Python-2.4 Installs on Windows

2004-12-14 Thread "Martin v. Löwis"
Fredrik Lundh wrote: http://www.python.org/2.4/msi.html which might be great if you know how things work, but is bloody confusing if you don't. most importantly, how do you set properties? How do you know they are called properties?-) I would have thought that "Additional parameters can be passe

Re: New versions breaking extensions, etc.

2004-12-14 Thread "Martin v. Löwis"
Cameron Laird wrote: Part of the trick is that it demands deep understanding to detect the antisynergies that arise from the interac- tions of the DLL, registry, and filesystem schemes. I know it was only this year that I realized the whole installation-requires-reboot absurdity is a consequence o

Re: Python IDE

2004-12-14 Thread dimitri pater
Hi, Try WingIDE if you have some money (about 35 E/$ for the personal version) to spend, it's worth every (euro)cent. But please try SPE first, maybe that's enough for you. Dimitri On Tue, 14 Dec 2004 11:36:34 -0500, Chris <[EMAIL PROTECTED]> wrote: > What IDE's do y'all recommend for Python? I

Re: lies about OOP

2004-12-14 Thread Martijn Faassen
Paul McGuire wrote: [snip] I would characterize the 80's as the transitional decade from structured programming (which really started to hit its stride when Djikstra published "Use of GOTO Considered Harmful") to OOP, and that OOP wasn't really "joyful" until the early-to-mid 90's. IMMEDIATE NOTICE

Re: How do I convert characters into integers?

2004-12-14 Thread Kent Johnson
Markus Zeindl wrote: I have got a string from the user, for example "Hi!". Now I get every character with a loop: buffer = "" for i in range(len(message)): ch = message[i-1:i] for ch in message: ... is simpler and more idiomatic. Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: lies about OOP

2004-12-14 Thread Paul McGuire
"Martijn Faassen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Paul McGuire wrote: > [snip] > > I would characterize the 80's as the transitional decade from structured > > programming (which really started to hit its stride when Djikstra published > > "Use of GOTO Considered Harmf

Re: lies about OOP

2004-12-14 Thread Mike Meyer
[EMAIL PROTECTED] writes: > If OOP is so beneficial for large projects, why are the Linux kernel, > the interpreters for Perl and Python, and most compilers I know written > in C rather than C++? Because C++ combines the worst features of C and OO programming. It also makes some defaults go the w

Re: lies about OOP

2004-12-14 Thread Jive
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I was just reacting mostly to the OP's statement that "by '86 the Joy of OOP > was widely known". I (Jive Dadson) said that. I guess I figured that if I knew about it, it was widely known. But in retrospect, I had an i

Re: lies about OOP

2004-12-14 Thread Carl Banks
projecktzero wrote: > He thinks that OOP has more overhead I think he's just confusing programming with marriage. -- CARL BANKS -- http://mail.python.org/mailman/listinfo/python-list

Dynamically passing variables to unittest

2004-12-14 Thread Tom Haddon
Hi Folks, Newbie question here. I'm trying to set up some unit testing for a database abstraction class, and the first thing I want to test is the connection parameters. So, my question is, how do I dynamically pass the variables from a list, for example to the unittest module so I can maintain

Re: Dynamically passing variables to unittest

2004-12-14 Thread Mark McEahern
Tom Haddon wrote: Hi Folks, Newbie question here. I'm trying to set up some unit testing for a database abstraction class, and the first thing I want to test is the connection parameters. So, my question is, how do I dynamically pass the variables from a list, for example to the unittest module so

I DECLARE THIS THREAD FINISHED

2004-12-14 Thread Jive
Everyone keep moving. There is nothing to see here. Move along. -- http://mail.python.org/mailman/listinfo/python-list

Re: python gui

2004-12-14 Thread Peter Hansen
Jeff Shannon wrote: zhao wrote: python 2.4 is released, but the gui package wxpython now is only for 2.3, how long can it can released for 2.4? This has been asked numerous times on the wxPython list in recent weeks. :) Robin Dunn is reportedly working now on updating his build environment and

Re: gather information from various files efficiently

2004-12-14 Thread Mike Meyer
Simon Brunning <[EMAIL PROTECTED]> writes: > On Tue, 14 Dec 2004 10:40:56 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: >> Keith Dart wrote: >> > Sigh, this reminds me of a discussion I had at my work once... It seems >> > to write optimal Python code one must understand various probabilites of >

<    1   2