Re: Is the Python binding for ncurses unicode capable?

2006-01-20 Thread Martin v. Löwis
Thomas Dickey wrote: > Both libraries respond to locale. But ncurses only deals in single-byte > encodings, e.g., ISO-8859-1 through ISO-8859-15. ncursesw supports that, > but adds support for multi-byte encodings, e.g., UTF-8. For the latter, > one can also have characters that combine (a print

saxutils.XMLGenerator and CDATA

2006-01-20 Thread chris
Confused somewhat xml newbie. I'm trying to output xml with a CDATA section, using saxutils.XMLGenerator, but the output contains escaped '<' and '>' and '&' from the CDATA element. Shouldn't it be spit out intact? Here's code and output: from xml.sax import saxutils import sys handler = saxut

Re: Firefox bug in webbrowser module on Ubuntu?!

2006-01-20 Thread Paul Boddie
SPE - Stani's Python Editor wrote: > > During optimizing SPE for Ubuntu, I found something strange. I have > Ubuntu 5.10 "The Breezy Badger" and unfortunately this code is not > working: > > >>> import webbrowser > >>> webbrowser.open("http://www.python.org";) > > It does not throw an exception, bu

Why optparse wont import?

2006-01-20 Thread Karlo Lozovina
If I create a file with only one line: --- from optparse import OptionParser --- I get this when I try to run it from "DOS" prompt: Traceback (most recent call last): File "optparse.py", line 1, in ? from optparse import OptionParser File "X:\data\other\source\python\population\optparse.

Re: ConfigParser: writes a list but reads a string?

2006-01-20 Thread funkyj
I'm interested in the same sort of config file issues. Unfortunately the restricted execution has fallen out of favor. My preferred solution would be to have a configEval() function that is just like the regular Python eval() but only accepts a subset of the python language, e.g. creating the bas

Re: Why optparse wont import?

2006-01-20 Thread Jorge Godoy
Karlo Lozovina <[EMAIL PROTECTED]> writes: > If I create a file with only one line: > > --- > from optparse import OptionParser > --- > > I get this when I try to run it from "DOS" prompt: > > Traceback (most recent call last): > File "optparse.py", line 1, in ? > from optparse import Option

Re: saxutils.XMLGenerator and CDATA

2006-01-20 Thread Robert Kern
chris wrote: > Confused somewhat xml newbie. I'm trying to output xml with a CDATA > section, using saxutils.XMLGenerator, but the output contains escaped > '<' and '>' and '&' from the CDATA element. Shouldn't it be spit out > intact? > > Here's code and output: > > from xml.sax import saxuti

Re: Python code written in 1998, how to improve/change it?

2006-01-20 Thread Bengt Richter
On Thu, 19 Jan 2006 23:16:57 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: >Carl Cerecke wrote: >> Carl Cerecke wrote: >>>Ah. Well, my post suggested, as one option, the callables call >>>each other directly. >> >> Doh! No I didn't. And they shouldn't. Otherwise the call stack >> gets out of han

Re: Strange python behavior with modules on an emt64 box

2006-01-20 Thread Tim Peters
[Joshua Luben] > I thought I would post this here first before seeking more experienced ears > for this particular strangness. > > I have Python 2.4.2 installed from source on a dual processor dell server. > These are x86_64 processors (verified by /bin/arch) (aka emt64 extensions). > > uname -a gi

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-20 Thread Steven D'Aprano
On Thu, 19 Jan 2006 10:08:38 +0100, Claudio Grondi wrote: > The point is to find a way to create in Python two indentifiers a and b > without manipulating any of the __eq__ and to __eq__ related functions > in a way, that the simple >if a==b: print 'a==b' > statement results in an endless lo

Re: python & camera

2006-01-20 Thread Peter Hansen
Alex Gittens wrote: > I'm working on a final project for my EE degree that requires the use > of digital camera with high resolution. I'd like to do the image > capture with Python, preferably in a cross-platform manner, but if > necessary, we can limit ourselves to Windows. Any ideas on > modules/

Re: Why optparse wont import?

2006-01-20 Thread Karlo Lozovina
Jorge Godoy <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Rename your file to something other than optparse.py... Oh my :(... I'm so ashamed :). -- ___Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 106

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-20 Thread Claudio Grondi
Steven D'Aprano wrote: > On Thu, 19 Jan 2006 10:08:38 +0100, Claudio Grondi wrote: > > >>The point is to find a way to create in Python two indentifiers a and b >>without manipulating any of the __eq__ and to __eq__ related functions >>in a way, that the simple >> if a==b: print 'a==b' >>stat

Re: Is the Python binding for ncurses unicode capable?

2006-01-20 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > I don't have any problems with simply printing the characters from > Python (outside of ncurses), but using the ncurses functions for > printing these characters is problematic. I see. I can't get this to work, either, and neither with libncursesw. Regards, Martin -- h

Numarray, numeric, NumPy, scpy_core ??!!

2006-01-20 Thread J
Hi I hope the title of this message indicates my question. I am looking for basic array functionality in Python and it turns out that there are all these packages which are somehow related. Some are allegedly discontinued but still seem to get updated. Could we start a discussion about which packa

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-20 Thread Claudio Grondi
J wrote: > Hi > > I hope the title of this message indicates my question. I am looking > for basic > array functionality in Python and it turns out that there are all these > packages which > are somehow related. Some are allegedly discontinued but still seem to > get updated. Could we start a dis

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-20 Thread Robert Kern
J wrote: > Hi > > I hope the title of this message indicates my question. I am looking > for basic > array functionality in Python and it turns out that there are all these > packages which > are somehow related. Some are allegedly discontinued but still seem to > get updated. Could we start a dis

Re: OT: excellent book on information theory

2006-01-20 Thread Steven D'Aprano
On Thu, 19 Jan 2006 03:20:04 -0800, Anton Vredegoor wrote: > The old trick of 'but there are some things > that cannot be expressed in any other way than by using formulas' > doesn't get one many optimization points in my world. Alas, your world is not as precise and accurate as the world of math

Off Topic (OT) Message

2006-01-20 Thread Bob Harding
  We are looking for a 1981 graduate from Gaithersburg High School, Maryland. We believe he may frequent this list, hence this post. Please contact us at [EMAIL PROTECTED]. Thank you. Bob/Mary Harding -- http://mail.python.org/mailman/listinfo/python-list

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-20 Thread Robert Kern
Claudio Grondi wrote: > I decided to use numarray, so maybe you can report what your problem/bug > is before I run into it myself? The reason why I decided to use numarray > was, that the whole scpy_core story seems to get more or less commercial > and its free version comes because of this wit

Re: OT: excellent book on information theory

2006-01-20 Thread Steven D'Aprano
On Thu, 19 Jan 2006 14:12:24 +0200, Juho Schultz wrote: > Because the intended audience is probably reads formulas better than > they read Python. The 1st sentence of the Introduction: "This book is > aimed at senior undergraduates and graduate students in Engineering, > Science, Mathematics and

Re: OT: excellent book on information theory

2006-01-20 Thread Paul Rubin
"Anton Vredegoor" <[EMAIL PROTECTED]> writes: > Returning to the original book, why did they write a lot of it (at > least the first few pages until I gave up, after having trouble > understanding formulas about concepts I have no such trouble with when > framed in less jargonized from) in unintell

Re: How to generate graphics dynamically on the web using Python CGI script?

2006-01-20 Thread Steve Holden
David Wahler wrote: > Xavier Morel wrote: > >>Steve Holden wrote: >> >>>Luiz Geron wrote: >>> I don't have experience on this, but I think that you can make the script return the image "contents" directly to the img tag, without passing it to a img file, so you can use something like t

Re: Is there a maximum length of a regular expression in python?

2006-01-20 Thread Steve Holden
Bryan Olson wrote: > Roy Smith wrote: > >> [EMAIL PROTECTED] wrote: >> >> >> >>>I have a regular expression that is approximately 100k bytes. (It is >>>basically a list of all known norwegian postal numbers and the >>>corresponding place with | in between. I know this is not the intended >>>use fo

Re: OT: excellent book on information theory

2006-01-20 Thread Steven D'Aprano
On Thu, 19 Jan 2006 15:04:51 +0100, Mikael Olofsson wrote: > One question here is: Are US English and UK English different languages > or not? If they are, a translation is in place. If they are not, the > text should have been left as is. I guess the answer is: > -Well, sort of... That's the s

Re: How to generate graphics dynamically on the web using Python CGI script?

2006-01-20 Thread chris
This is a cool product that can produce any number of types of graphs. Supports Python, as well as lots of other languages. I have used it with success. There is a free version, as long as you don't mind the tiny logo they put into each graph. http://www.advsofteng.com/ -Chris -- http://mail.

Re: Is there a maximum length of a regular expression in python?

2006-01-20 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > > Does no one care about an internal error in the regular expression > > engine? > > > Not one that requires parsing a 100 kilobyte re that should be > replaced by something more sensible, no. If the internal error means the re engine bumped into some int

Re: Why optparse wont import?

2006-01-20 Thread Steve Holden
Karlo Lozovina wrote: > Jorge Godoy <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > >>Rename your file to something other than optparse.py... > > > Oh my :(... I'm so ashamed :). > Don't worry. If this list had a FAQ, that would be on it. You are by no means the first ... regards

Re: Is there a maximum length of a regular expression in python?

2006-01-20 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > > > Does no one care about an internal error in the regular expression > > > engine? > > > > > Not one that requires parsing a 100 kilobyte re that should be > > replaced by s

Re: Is there a maximum length of a regular expression in python?

2006-01-20 Thread Tim Peters
[Bryan Olson] >> Does no one care about an internal error in the regular expression >> engine? [Steve Holden] > Not one that requires parsing a 100 kilobyte re that should be replaced > by something more sensible, no. I care: this is a case of not detecting information loss due to unchecked down

Re: Problem with running external process

2006-01-20 Thread Chmouel Boudjnah
see the help for ulimit (builtils) : -$ help limit -- http://mail.python.org/mailman/listinfo/python-list

Re: Python code written in 1998, how to improve/change it?

2006-01-20 Thread Steven D'Aprano
On Fri, 20 Jan 2006 10:27:58 +1300, Carl Cerecke wrote: > We want a goto. > > Unfortunately, this is about the only problem I can think of where gotos > are useful. And for reasons well explained elsewhere, gotos are Not Good. > > I've solved this in a very efficient, but rather unpythonic way.

Read from Serial Port

2006-01-20 Thread Casey Bralla
I'd like to read ASCII data from a serial port, but (once again) I'm having trouble getting started. (Can't seem to find the basic level of docs to get going ) I'd like to use only standard "built-in" modules if possible. Could somebody offer a simple code-snippet to get me started reading from

Re: [OT] Nit: please don't user "it's" unless you can substitute "it is" without changing your inteded meaning.

2006-01-20 Thread Steven D'Aprano
On Fri, 20 Jan 2006 07:06:29 +, Tim Roberts wrote: > My own name gives me trouble with this. There is disagreement in the > curmudgeon world as to whether I should refer to "the Roberts' computer", > or "the Roberts's computer". > > I guess I'll just have to keep saying "that damn computer."

Re: Is there a maximum length of a regular expression in python?

2006-01-20 Thread Steve Holden
Tim Peters wrote: > [Bryan Olson] > >>>Does no one care about an internal error in the regular expression >>>engine? > > > [Steve Holden] > >>Not one that requires parsing a 100 kilobyte re that should be replaced >>by something more sensible, no. > > > I care: this is a case of not detectin

Re: why is my hash being weird??

2006-01-20 Thread Steven D'Aprano
On Thu, 19 Jan 2006 18:59:11 -0800, pycraze wrote: > Surely adopting the above method is much better than what i have > approached earlier . The main reason i did adopt this exercise was when > i have to marshal a 20 - 40 MB above test.py file to the disk , the > simple load of the test.py will sk

Re: OT: excellent book on information theory

2006-01-20 Thread Grant Edwards
On 2006-01-21, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> One question here is: Are US English and UK English different languages >> or not? If they are, a translation is in place. If they are not, the >> text should have been left as is. I guess the answer is: >> -Well, sort of... > > That's

Re: OT: excellent book on information theory

2006-01-20 Thread Steve Holden
Steven D'Aprano wrote: > On Thu, 19 Jan 2006 14:12:24 +0200, Juho Schultz wrote: > > >>Because the intended audience is probably reads formulas better than >>they read Python. The 1st sentence of the Introduction: "This book is >>aimed at senior undergraduates and graduate students in Engineerin

Re: Decimal vs float

2006-01-20 Thread Steven D'Aprano
On Fri, 20 Jan 2006 04:25:01 +, Bengt Richter wrote: > On Thu, 19 Jan 2006 12:16:22 +0100, =?ISO-8859-1?Q?Gerhard_H=E4ring?= <[EMAIL > PROTECTED]> wrote: > [...] >> >>floating points are always imprecise, so you wouldn't want them as an > Please, floating point is not "always imprecise." In

Re: OT: excellent book on information theory

2006-01-20 Thread Paul Rubin
Grant Edwards <[EMAIL PROTECTED]> writes: > The next thing you know, there are going to be American > translations of Jane Austin where a girl says to her sister > "dude, he is such a hottie!" and she replies "oh my god, for > sure!" I actually heard that the US film version of Pride and Prejudic

Re: Read from Serial Port

2006-01-20 Thread Steve Holden
Casey Bralla wrote: > I'd like to read ASCII data from a serial port, but (once again) I'm having > trouble getting started. (Can't seem to find the basic level of docs to > get going ) > > I'd like to use only standard "built-in" modules if possible. > > Could somebody offer a simple code-snipp

Variables and none?

2006-01-20 Thread Ivan Shevanski
Alright first of all I'd like to say I'm a python noob.Now that thats over with, heres what I'd like to know about.  Is there a python way to detect if a variable exsists?  Say I had a program that needed a certain variable to be set to run and the variable was not found when it came time to use it

Re: Read from Serial Port

2006-01-20 Thread Grant Edwards
On 2006-01-21, Casey Bralla <[EMAIL PROTECTED]> wrote: > I'd like to read ASCII data from a serial port, but (once > again) I'm having trouble getting started. (Can't seem to > find the basic level of docs to get going ) > > I'd like to use only standard "built-in" modules if possible. Then ther

Re: Decimal vs float

2006-01-20 Thread Steve Holden
Steven D'Aprano wrote: > On Fri, 20 Jan 2006 04:25:01 +, Bengt Richter wrote: > > >>On Thu, 19 Jan 2006 12:16:22 +0100, =?ISO-8859-1?Q?Gerhard_H=E4ring?= <[EMAIL >>PROTECTED]> wrote: >>[...] >> >>>floating points are always imprecise, so you wouldn't want them as an >> >>Please, floating po

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-20 Thread Steven D'Aprano
On Sat, 21 Jan 2006 01:12:28 +0100, Claudio Grondi wrote: > Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on > win32 - IDLE 1.1.2 > >>> a=[] > >>> a.append(a) > >>> b=[] > >>> b.append(b) > >>> a==b > > Traceback (most recent call last): >File "", line 1, in -top

Re: OT: excellent book on information theory

2006-01-20 Thread Steve Holden
Grant Edwards wrote: > On 2006-01-21, Steven D'Aprano <[EMAIL PROTECTED]> wrote: [...] >>But the real question is why it is that American publishers >>believe their readers are so lazy and ignorant that they >>require special "translations" of British books. I don't know >>anyone who has said "I'm

Re: Variables and none?

2006-01-20 Thread Ivan Shevanski
On 1/20/06, Ivan Shevanski <[EMAIL PROTECTED]> wrote: Alright first of all I'd like to say I'm a python noob.Now that thats over with, heres what I'd like to know about.  Is there a python way to detect if a variable exsists?  Say I had a program that needed a certain variable to be set to run and

Re: Variables and none?

2006-01-20 Thread Steve Holden
Ivan Shevanski wrote: > Alright first of all I'd like to say I'm a python noob. > Welcome to c.l.py. > Now that thats over with, heres what I'd like to know about. Is there a > python way to detect if a variable exsists? Say I had a program that > needed a certain variable to be set to run an

Re: OT: excellent book on information theory

2006-01-20 Thread Grant Edwards
On 2006-01-21, Paul Rubin wrote: >> The next thing you know, there are going to be American >> translations of Jane Austen where a girl says to her sister >> "dude, he is such a hottie!" and she replies "oh my god, for >> sure!" > > I actually heard that the US film version of Pride and Prejudic

Re: Decimal vs float

2006-01-20 Thread Steven D'Aprano
On Sat, 21 Jan 2006 03:48:26 +, Steve Holden wrote: > Steven D'Aprano wrote: >> On Fri, 20 Jan 2006 04:25:01 +, Bengt Richter wrote: >> >> >>>On Thu, 19 Jan 2006 12:16:22 +0100, =?ISO-8859-1?Q?Gerhard_H=E4ring?= >>><[EMAIL PROTECTED]> wrote: >>>[...] >>> floating points are always i

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-20 Thread Tim Peters
[Claudio Grondi] >> Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 - IDLE 1.1.2 >> >>> a=[] >> >>> a.append(a) >> >>> b=[] >> >>> b.append(b) >> >>> a==b >> >> Traceback (most recent call last): >>File "", line 1, in -toplevel- >> a==b >> RuntimeError:

Re: sockets

2006-01-20 Thread Allan Zhang
> >> the following code works perfectly >> import socket, sys >> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >> s.connect(("www.python.org", 80)) >> s.send("GET") here, You need to speak HTTP protocol. I would suggest to change s.send( "GET / HTTP/1.0\x0d\x0a\x0d\x0a" ) >> whi

Re: Problem with running external process

2006-01-20 Thread Donn Cave
Quoth "ToMasz" <[EMAIL PROTECTED]>: | There is a script running continuously which executes an external | script in a loop using os.spawnlp(os.P_WAIT, 'extscript.py') function. | After several hundred executions (cycles of the loop), the main script | gets an exception while trying to start the pro

Re: Firefox bug in webbrowser module on Ubuntu?!

2006-01-20 Thread ncf
This section is the cause of the problem: for browser in ("mozilla-firefox", "mozilla-firebird", "mozilla", "netscape"): if _iscommand(browser): register(browser, None, Netscape(browser)) It's trying to load "mozilla-firefox" as the exec

Python shell interpreting delete key as tilde?

2006-01-20 Thread Leif K-Brooks
I'm running Python 2.3.5 and 2.4.1 under Debian Sarge. Instead of deleting the character after the cursor, pressing my "delete" key in an interactive Python window causes a system beep and inserts a tilde character. This behavior occurs across all of the terminals I've tried (xterm, Konsole, real L

New Bee

2006-01-20 Thread Prasanna
Hi all, I am new to this group.I am willing to learn PYTHON can anyone suggest me where to start.I have installed PYTHON 2.4 windows platform.Where can I get books for beginners.How to go about?.It would be helpful if anyone is will to guide me. Thanks and Regards, Prasanna -- http://mail.python

Re: Decimal vs float

2006-01-20 Thread Kay Schluehr
Steven D'Aprano wrote: > On Sat, 21 Jan 2006 03:48:26 +, Steve Holden wrote: > > > Steven D'Aprano wrote: > >> On Fri, 20 Jan 2006 04:25:01 +, Bengt Richter wrote: > >> > >> > >>>On Thu, 19 Jan 2006 12:16:22 +0100, =?ISO-8859-1?Q?Gerhard_H=E4ring?= > >>><[EMAIL PROTECTED]> wrote: > >>>[...

Re: New Bee

2006-01-20 Thread phildini
One great place to start is the Python documentation website (http://www.python.org/doc/). They have soe very good basic info, both third-party tutorials as well as a tutorial writeen bu Guido Van Rossum (creator of Python). Guido's tutorial expects programming experience, so if you are a true begi

<    1   2