encoding specified in XML declaration is incorrect

2004-12-02 Thread Gustaf Liljegren
I'm using xml.sax.parseString to read an XML file. The XML file contains a few words in Russian, and is encoded in UTF-8 using C#. In the example below, MyParser() is my SAX ContentHandler class. My first try was: f = open('words.xml', 'r') s = f.read() xml.sax.parseString(s, MyParser()) This

Re: Delphi underrated, IDE clues for Python

2004-12-02 Thread johng2001
Yes! Boa goes a long way. I have been using it for almost 2 1/2 years now. But it does not come close to the comfort of Delphi. But then of course, Delphi is not just a WYSIWYG GUI designer. VCL is very advanced compared to GUI toolkits available for Python. The community has over the years

Re: Python 2.4 and Tkinter

2004-12-02 Thread Eric Brunel
Jeffrey Barish wrote: [snip] Here's what I get when I import Tkinter at a python prompt: [EMAIL PROTECTED]:~$ python Python 2.4 (#1, Nov 30 2004, 08:58:13) [GCC 3.2.3 20030316 (Debian prerelease)] on linux2 Type help, copyright, credits or license for more information. import Tkinter Traceback

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2004-12-02 Thread Robin Becker
Cameron Laird wrote: QOTW: ... why does Microsoft try so hard to protect its sources? . 2.4 is final, buildable under Windows in at least a couple of ways, improved, ... http://www.brunningonline.net/simon/blog/archives/001657.html asyncore, Twisted, the Python

Re: M2Crypto for 2.4

2004-12-02 Thread elbertlev
//I will do it in the next day or two. Me too! Remember, this is a programmer and a manager telling you his plan. :) But, if I do not, nobody in my department will :( -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Win32 Silent Install

2004-12-02 Thread David Fraser
Thomas Heller wrote: Matt Gerrans [EMAIL PROTECTED] writes: Looks like the installer for the Win32 extensions has changed from Wise to distutils, so now my automated silent installations don't work anymore. Anyone know if the distutils binary installer can be run silently?I haven't been

Re: pre-PEP generic objects

2004-12-02 Thread Nick Craig-Wood
Scott David Daniels [EMAIL PROTECTED] wrote: Nick Craig-Wood wrote: class Hash: def __init__(self, **kwargs): for key,value in kwargs.items(): setattr(self, key, value) def __getitem__(self, x): return getattr(self, x) def __setitem__(self,

pyOpenSSL and Python 2.4? or alternatives...

2004-12-02 Thread Ola Natvig
Anyone that knows anyone knows a win32 Py2.4 build of pyOpenSSL? Or perhaps has a outstanding alternative to this SSL package. It's imperative the package is as simmilar to the standard socket library of python. Anyone? -- -- Ola Natvig [EMAIL PROTECTED]

PIL and antialiasing problem

2004-12-02 Thread Laszlo Zsolt Nagy
Hi all, I have a little problem with PIL. I need to display images in a browser (thumbnails) (this is the selector window). I also need the original version of the image to be displayed in a Java applet. One example: thumbnail: http://designasign.biz/applet/GIF_Small/AIRCRAFT/a10per.png

Re: A little threading problem

2004-12-02 Thread Alban Hertroys
Jeremy Jones wrote: (not waiting, because it already did happen). What is it exactly that you are trying to accomplish? I'm sure there is a better approach. I think I saw at least a bit of the light, reading up on readers and writers (A colleague showed up with a book called Operating system

readline() omitted '\r' in win32 for dos format text file

2004-12-02 Thread Newgene
Hi, group, I have python2.3 installed on win2k. I noticed that when I open a dos format text file (eol is '\r\n'), readline() always returns a line ending with '\n' only, not '\r\n'. While I read the same file on unix, it returns a line ending with '\r\n' correctly. This makes me difficult to

Re: readline() omitted '\r' in win32 for dos format text file

2004-12-02 Thread Peter Otten
Newgene wrote: I have python2.3 installed on win2k. I noticed that when I open a dos format text file (eol is '\r\n'), readline() always returns a line ending with '\n' only, not '\r\n'. While I read the same file on unix, it returns a line ending with '\r\n' correctly. This makes me

Re: XUL Parser?

2004-12-02 Thread Alberto Berti
Hi, I'm slowly developing a thin client environment that will use xul, or a part of it as gui language, all done in python and that uses python instead of js as scripting language and event binding. It builds the gui using pyGTK. Who is interested can find more info here:

Re: A little threading problem

2004-12-02 Thread Jeremy Jones
Alban Hertroys wrote: Jeremy Jones wrote: (not waiting, because it already did happen). What is it exactly that you are trying to accomplish? I'm sure there is a better approach. I think I saw at least a bit of the light, reading up on readers and writers (A colleague showed up with a book

Re: non blocking read()

2004-12-02 Thread Gustavo Córdova Avila
Donn Cave wrote: Depends. I don't believe the original post mentioned that the file is a pipe, socket or similar, but it's kind of implied by the use of select() also mentioned. It's also kind of implied by use of the term block - disk files don't block. If we are indeed talking about a pipe or

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Jp Calderone
On Thu, 02 Dec 2004 15:29:53 +0100, Peter Maas [EMAIL PROTECTED] wrote: Diez B. Roggisch schrieb: Same task on Win2k: download wxPython-setup.exe, double-click, done. Took me approx. 1 minute. This strikes me. Why are some tasks so hard on Linux and so easy on Windows? After all wxPython/Win

installer

2004-12-02 Thread km
Hi all, does python have a default module installer inbuilt as for perl in windows ? tia , KM -- http://mail.python.org/mailman/listinfo/python-list

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Antoon Pardon
Op 2004-12-02, Peter Maas schreef [EMAIL PROTECTED]: Diez B. Roggisch schrieb: Same task on Win2k: download wxPython-setup.exe, double-click, done. Took me approx. 1 minute. This strikes me. Why are some tasks so hard on Linux and so easy on Windows? After all wxPython/Win and wxPython/Lin are

Re: non blocking read()

2004-12-02 Thread Steve Holden
Gustavo Córdova Avila wrote: Donn Cave wrote: Depends. I don't believe the original post mentioned that the file is a pipe, socket or similar, but it's kind of implied by the use of select() also mentioned. It's also kind of implied by use of the term block - disk files don't block. If we are

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2004-12-02 Thread Rocco Moretti
For some reason I can't seem to make use of the google links. When I use the above eg http://groups.google.com/groups?frame=rightth=e562a771d1c827c9 I get a not found google page with url http://groups-beta.google.com/groups?frame=rightth=e562a771d1c827c9 really wanted to spell file in a sickly

Re: non blocking read()

2004-12-02 Thread Gustavo Córdova Avila
Steve Holden wrote: Gustavo Córdova Avila wrote: Actually the op did mention that he wanted to monitor files. As was pointed out to me when I made the same assertion, he actually said file object which is stdin or something like that, which means the object could be a socket, a pipe, a file, a

Re: non blocking read()

2004-12-02 Thread Steve Holden
Gustavo Córdova Avila wrote: Steve Holden wrote: Gustavo Córdova Avila wrote: Actually the op did mention that he wanted to monitor files. As was pointed out to me when I made the same assertion, he actually said file object which is stdin or something like that, which means the object could be

Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2004-12-02 Thread Cameron Laird
QOTW: ... why does Microsoft try so hard to protect its sources? To avoid embarrassment. -- Peter Maas and Grant Edwards http://groups.google.com/groups?frame=leftth=9a599152d8b23b54 Sufficiently advanced cluelessness is indistinguishable from malice. -- Alex Martelli 2.4 is final,

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Colin J. Williams
Jp Calderone wrote: On Thu, 02 Dec 2004 15:29:53 +0100, Peter Maas [EMAIL PROTECTED] wrote: Diez B. Roggisch schrieb: Same task on Win2k: download wxPython-setup.exe, double-click, done. Took me approx. 1 minute. This strikes me. Why are some tasks so hard on Linux and so easy on Windows? After

Re: debian python2.4

2004-12-02 Thread Nick Vargish
km [EMAIL PROTECTED] writes: is there a debian binary of python2.4 ? root# apt-get update root# apt-cache search python2.4 idle-python2.4 - An IDE for Python (v2.4) using Tkinter python2.4 - An interactive high-level object-oriented language (version 2.4) python2.4-dev - Header files and a

Re: decorators ?

2004-12-02 Thread Michael Hudson
Skip Montanaro [EMAIL PROTECTED] writes: Jacek Anything you can do with decorators, you could do before (with Jacek the exception of rebinding the __name__ of functions). And while that feature was added because we realized it would be nice if the decorated function could have the

Galois field

2004-12-02 Thread Roie Kerstein
I am looking for a python package that deals with galois fields. Does anybody know where can I find it? Thank in advance -- Best regards Roie Kerstein -- http://mail.python.org/mailman/listinfo/python-list

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2004-12-02 Thread Thomas Heller
Gerrit [EMAIL PROTECTED] writes: Cameron Laird wrote: Subject: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2) What is the frequency of the weekly Python-URL? (-; According to the name, about 1.6 µHz. Thomas -- http://mail.python.org/mailman/listinfo/python-list

efficient intersection of lists with rounding

2004-12-02 Thread Gordon Williams
Hi, I have to lists that I need to find the common numbers (2nd rounded to nearest integral) and I am wondering if there is a more efficient way of doing it. a= [(123,1.3),(123,2.4),(123,7.8),(123,10.2)] b= [(123, 0.9), (123, 1.9), (123, 8.0)] [ (i,round(j)) for i,j in a for l,m in b if

Re: PySQLLite Speed

2004-12-02 Thread Robert Kern
Kevin wrote: Hello All, I wondering if anyone has encountered the same issue with using PySQL. This is my first time using this DB so this preformance may be typical. I'm reading an ASCII file through PyParse that contains about 1.3Meg of Float data. 8000 Triangles (3 Vertexes and 1 Normal).

installing 2.4

2004-12-02 Thread Jive
I just now installed 2.4. I naively copied my site-package from 2.3. The first program I tried to run, which uses the gnuplot package, got this error, complaining about module Numeric: ImportError: Module use of python23.dll conflicts with this version of Python. Grumble: Why does Numeric

Re: installing 2.4

2004-12-02 Thread Jive
Well ain't that a kick in the pants? Version 2.3 is broke now, so I'm kind of stuck. I haven't found a 2.4 version of Numeric. Do you know where to find one? Peter Hansen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jive wrote: I just now installed 2.4. I naively copied my

Re: PyQt on a Server

2004-12-02 Thread Bob Parnes
On 29 Nov 2004 11:07:48 -0500, Jerry Sievers [EMAIL PROTECTED] wrote: Bob Parnes [EMAIL PROTECTED] writes: I have an application importing qt on a linux server and am missing something in trying to run it from a workstation via nfs. The workstation has the server /usr directory mounted to

Re: non blocking read()

2004-12-02 Thread Greg Ewing
Donn Cave wrote: Yes, this looks right to me, but I think we're talking about os.read(), not fileobject.read(). Indeed, you shouldn't be mixing select() with buffered io, or all kinds of bad things can happen. Everything I said applies to OS-level reads and writes, not stdio-level ones. -- Greg

Re: PySQLLite Speed

2004-12-02 Thread Roger Binns
Kevin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Then when it starts to write the Database, the PC Util drops to 1-2% and it takes forever. I'm not PC related preformance barriers that I'm aware of. Your hard disk. See the synchronous information in the pragmas:

Re: installing 2.4

2004-12-02 Thread Jeff Shannon
Jive wrote: As for checking the application path, I don't know what that means. Go to a command prompt, and type 'echo %path%'. You'll see a list of all the directories that Windows looks in to find an executable -- i.e., if you type 'python', Windows will work through this list of

Re: inheritance problem with 2 cooperative methods

2004-12-02 Thread Greg Ewing
Dan Perl wrote: So far, so good! But let's assume that I want to change the __init__ methods so that they take a configuration as an argument so the objects are created and configured in one step, like this: alpha = A(config) One way would be to make the setConfig call only in the root class,

Re: installing 2.4

2004-12-02 Thread David Bolen
Jive [EMAIL PROTECTED] writes: It's only getting worse. I went to Add/remove programs and removed 2.4. Now Python 2.4 numarray and Python 2.4 pywin extensions are still listed as installed, but I cannot remove them. You mentioned in your first post about copying your site package ... did you

Re: installing 2.4

2004-12-02 Thread Jive
David Bolen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jive [EMAIL PROTECTED] writes: It's only getting worse. I went to Add/remove programs and removed 2.4. Now Python 2.4 numarray and Python 2.4 pywin extensions are still listed as installed, but I cannot remove them.

Re: efficient intersection of lists with rounding

2004-12-02 Thread Greg Ewing
Gordon Williams wrote: a= [(123,1.3),(123,2.4),(123,7.8),(123,10.2)] b= [(123, 0.9), (123, 1.9), (123, 8.0)] [ (i,round(j)) for i,j in a for l,m in b if (i,round(j)) == (l,round(m))] d = {} for (l, m) in b: d[l, round(m)] = 1 result = [] for (i, j) in a: t = (i, round(j)) if t in d:

Re: why python is slower than java?

2004-12-02 Thread developerchina
hehe Asun Friere wrote: [EMAIL PROTECTED] (Alex Martelli) wrote in message news:[EMAIL PROTECTED]... [A]sking for tolerance and patience against _rude_ newbies which barge in with shrill, mostly unjustified, repetitious complaints, is, I think, a rather far-fetched request. That request

Re: inheritance problem with 2 cooperative methods

2004-12-02 Thread Dan Perl
Thank you very much, Greg, that does the job! Somehow I couldn't see it and I needed someone to point out to me. Dan Greg Ewing [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dan Perl wrote: So far, so good! But let's assume that I want to change the __init__ methods so that

Re: efficient intersection of lists with rounding

2004-12-02 Thread Adam DePrince
On Thu, 2004-12-02 at 22:16, Greg Ewing wrote: Gordon Williams wrote: a= [(123,1.3),(123,2.4),(123,7.8),(123,10.2)] b= [(123, 0.9), (123, 1.9), (123, 8.0)] [ (i,round(j)) for i,j in a for l,m in b if (i,round(j)) == (l,round(m))] d = {} for (l, m) in b: d[l, round(m)] = 1 result =

Re: Python Design Patterns

2004-12-02 Thread Dave Cook
Tony Ha [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... Hello Dave, Thanks for pointing me to the Cookbook website. On 2004-11-29, Tony Ha [EMAIL PROTECTED] wrote: I wonder, can any Python guru out there translate the Java examples in For anyone translating Java to

Re: PySQLLite Speed

2004-12-02 Thread Adam DePrince
On Thu, 2004-12-02 at 23:39, Kevin wrote: Hello All, I wanted to thank Roger Binn for his email. He had the answer to my issue with writing speed. It's actual made an incredible change in the preformace. I didn't have to go all the way to implementing the synchronous mode(for my app).

Re: Python 2.4 and Tkinter

2004-12-02 Thread Jeffrey Barish
Jean Brouwers wrote: It is hard to tell what is wrong, exactly. Two suggestions: If this is a 32-bit build, why is there a -L/usr/X11R6/lib64 and *before* the regular -L/usr/X11R6/lib? Try to rerun just that line gcc -pthread _tkinter.so but without the -L/usr/X11R6/lib64

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Simon John
I have used the Fedora2 RPM's of wxPython 2.5.3.1 successfully on SUSE 9.1 Pro, 9.2 Pro and SLES 9 (and Fedora 3 for that matter) so you don't need to get a specific RPM for SUSE. I even built wxPython 2.5.3.1 with Python 2.4 on Fedora 2 today, it was not that hard - just followed

Re: how to list files with extension .txt in windows?

2004-12-02 Thread Aaron Bingham
ed wrote: I have used batch script to do it but it has a lot of issues with access denied... errors I pretty much given up using batch to do this. If you do not have permission to access the files, switching to a different language will not help you. You need to determine the cause of your