Find the closest relative

2007-05-25 Thread [EMAIL PROTECTED]
Hi I have three objects, all of them are instances of classes derived from a base class. Now, given one of the instance, I want to find the closest relative of the other two. How can I do this? This is how I implemented; I guess there must be elegant way to do this... def

Re: sockets, gethostname() changing

2007-05-25 Thread half . italian
On May 24, 8:50 pm, 7stud [EMAIL PROTECTED] wrote: Thanks for the response. On May 24, 9:24 pm, [EMAIL PROTECTED] wrote: I can't imagine why your hostname would be changing, unless you installed some of their proprietary software thats messing around with things. When I first started

Re: append

2007-05-25 Thread James T. Dennis
Bruno Desthuilliers [EMAIL PROTECTED] wrote: HMS Surprise a ?crit : Trying not to be a whiner but I sure have trouble finding syntax in the reference material. I want to know about list operations such as append. The only thing you have to know is that it doesn't exists. Python strings

Re: No file from stdin

2007-05-25 Thread Tartifola
Hi, On May 24, 9:48 am, Tartifola [EMAIL PROTECTED] wrote: Hi, suppose a script of python is waiting for a file from the stdin and none is given. How can I make the script to stop and, for example, print an error message? Sorry for the n00b question and thanks I'm not exactly

Re: Can I reference 1 instance of an object by more names ? rephrase

2007-05-25 Thread Stef Mientki
Again, I'm confident, again I didn't test. I did, ... ... and unfortunately it still gave errors. So for the moment I'll just stick to my lots of code solution, and I'll try again, when I've some more understanding of these Python internals. Anyway, thank you all for your assistance. cheers,

Re: No Python for Blackberry?

2007-05-25 Thread Tartifola
Hi, I could not find a version of Python that runs on a Blackberrry. I'm in the process to buy one of this smart phone and very interested in Python for Blackberry. Any success in installing it? - This sig is dedicated to the advancement of Nuclear

Re: File monitoring for all drive

2007-05-25 Thread Tim Golden
rohit wrote: hi i want to detect all file change operations(rename,delete,create) on ALL THE DRIVES of the hard disk But to go a little further than your question... are you sure you want to do this? It's going to put quite a load on your system and be not-very-scaleable. I haven't yet had

Re: Find the closest relative

2007-05-25 Thread 7stud
On May 25, 12:31 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: This is how I implemented; I guess there must be elegant way to do this... def find_closest_relative(a,b,c): c1 = b.__class__ c2 = b.__class__ while True: if isinstance(a, c1): return b

Re: Reading (and writing?) audio file tags

2007-05-25 Thread Jarek Zgoda
Paul Moore napisał(a): Anyway, what you want is Mutagen. It handles both Flac and Mp3 tags, as well as many others:http://www.sacredchao.net/quodlibet/wiki/Development/Mutagen Excellent! The web page you mentioned gave access denied, but I got to it via Google's cache, and the download link

Re: Can I reference 1 instance of an object by more names ? rephrase

2007-05-25 Thread Peter Otten
Stef Mientki wrote: Again, I'm confident, again I didn't test. I did, ... ... and unfortunately it still gave errors. Strange. So for the moment I'll just stick to my lots of code solution, and I'll try again, when I've some more understanding of these Python internals. Anyway, here's

Re: Find the closest relative

2007-05-25 Thread [EMAIL PROTECTED]
On May 25, 12:40 pm, 7stud [EMAIL PROTECTED] wrote: On May 25, 12:31 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: This is how I implemented; I guess there must be elegant way to do this... def find_closest_relative(a,b,c): c1 = b.__class__ c2 = b.__class__ while

Re: Find the closest relative

2007-05-25 Thread [EMAIL PROTECTED]
On May 25, 12:40 pm, 7stud [EMAIL PROTECTED] wrote: On May 25, 12:31 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: This is how I implemented; I guess there must be elegant way to do this... def find_closest_relative(a,b,c): c1 = b.__class__ c2 = b.__class__ while

Re: Can I reference 1 instance of an object by more names ? rephrase

2007-05-25 Thread Stef Mientki
Peter Otten wrote: Stef Mientki wrote: Again, I'm confident, again I didn't test. I did, ... ... and unfortunately it still gave errors. Strange. indeed .. So for the moment I'll just stick to my lots of code solution, and I'll try again, when I've some more understanding of these

Re: stdlib doc for logger.findCaller() needs update.

2007-05-25 Thread Vinay Sajip
On May 23, 12:05 pm, [EMAIL PROTECTED] wrote: The logger objects findCaller() method is returning a 3 element tuple instead of 2 two as documented in the 2.4.4 Python Library Reference .DocString is showing it correctly. I've updated the docs - the next 2.4.x release should have them. Thanks

just a bug (was: xml.dom.minidom: how to preserve CRLF's inside CDATA?)

2007-05-25 Thread sim.sim
On 22 май, 16:45, sim.sim [EMAIL PROTECTED] wrote: Hi all. i'm faced to trouble using minidom: #i have a string (xml) within CDATA section, and the section includes \r\n: iInStr = '?xml version=1.0?\nData![CDATA[BEGIN:VCALENDAR\r \nEND:VCALENDAR\r\n]]/Data\n' #After i create DOM-object, i

psycopg2 large result set

2007-05-25 Thread Jon Clements
Hi All. I'm using psycopg2 to retrieve results from a rather large query (it returns 22m records); unsurprisingly this doesn't fit in memory all at once. What I'd like to achieve is something similar to a .NET data provider I have which allows you to set a 'FetchSize' property; it then retrieves

method override inside a module

2007-05-25 Thread Fabrizio Pollastri
Hello, I am trying to override a method of a class defined into an imported module, but keeping intact the namespace of the imported module. For example, let suppose import module_X and in module_X is defined something like class A: ... def method_1():

Re: What is an instance and what isn't?

2007-05-25 Thread Dave Baum
In article [EMAIL PROTECTED], Gre7g Luterman [EMAIL PROTECTED] wrote: I suppose I was lulled into complacency by how Python makes so many things look like classes, but I'm starting to realize that they're not, are they? I'm writing a C program which handles Python objects in different ways

Re: Lists vs tuples (newbie)

2007-05-25 Thread Hendrik van Rooyen
Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-05-22, Duncan Booth [EMAIL PROTECTED] wrote: Hendrik van Rooyen [EMAIL PROTECTED] wrote: Aside from the hashing issue, there is nothing that a tuple can do that can't be done as well or better by a list. There are a few other cases

Re: Shared Memory Space - Accross Apps Network

2007-05-25 Thread Hendrik van Rooyen
From: D.Hering v gmail.com wrote: On May 23, 4:04 am, Tim Golden [EMAIL PROTECTED] wrote: Robert Rawlins - Think Blue wrote: I did not see the original post either :-( ... I've got an application that runs on an embedded system, the application uses a whole bunch or dicts and

Re: drag and drop with wxPython ?

2007-05-25 Thread Stef Mientki
[EMAIL PROTECTED] wrote: On May 22, 10:00 am, stef [EMAIL PROTECTED] wrote: hello, I'm trying to move from Delphi to Python (move from MatLab to Python already succeeded, also thanks to this discussion group). From the discussions in this list about the best GUI for Python, it now seems

Re: just a bug (was: xml.dom.minidom: how to preserve CRLF's inside CDATA?)

2007-05-25 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], sim.sim wrote: Below the code that tryes to parse an well-formed xml, but it fails with error message: not well-formed (invalid token): line 3, column 85 How did you verified that it is well formed? `xmllint` barf on it too. The problem within CDATA-section: it

Re: Invalid thread state for this thread

2007-05-25 Thread Martin Evans
Just in case anyone else has seen this problem, after upgrading to 2.4.4 the problem appears to have resolved itself. I know this has been seen before but it is not making too much sense (after reading many posts). It all appears to work fine but then dies after about 40 invocations. My app

optparse: list out entered values

2007-05-25 Thread Nirnimesh
I'm using optparse.OptionParser for parsing command line arguments. parser = optparse.OptionParser() parser.add_option(-x, --xample, help=example, default=nothing, dest=ex) options = parser.parse_args()[0] python example.py -x value I'm in search of a method to list out all the

Compiling python extension on amd64 for 32 bit

2007-05-25 Thread Mathias Waack
After switching my development environment to 64 bit I've got a problem with a python extension for a 32 bit application. Compiling the app under Linux results in the following error: g++ -m32 -Wall -g -O2 -I. -Idb -DPYTHON=25 -o mappy.o -c mappy.cpp In file included from

Re: psycopg2 large result set

2007-05-25 Thread Rob Wolfe
Jon Clements wrote: Hi All. I'm using psycopg2 to retrieve results from a rather large query (it returns 22m records); unsurprisingly this doesn't fit in memory all at once. What I'd like to achieve is something similar to a .NET data provider I have which allows you to set a 'FetchSize'

Re: sockets, gethostname() changing

2007-05-25 Thread Gabriel Genellina
En Fri, 25 May 2007 00:04:04 -0300, 7stud [EMAIL PROTECTED] escribió: I'm experimenting with a basic socket program(from a book), and both the client and server programs are on my computer. In both programs, I call socket.gethostname(), but I discovered that when I am connected to the

Re: Find the closest relative

2007-05-25 Thread Gabriel Genellina
En Fri, 25 May 2007 05:09:00 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: Vehicle | |--- Two Wheeler | | | |--- BatteryPowered | |--- PetrolPowered | |--- DieselPowered | |--- Three Wheeler | | |

Re: psycopg2 large result set

2007-05-25 Thread Paul Boddie
On 25 May, 11:16, Jon Clements [EMAIL PROTECTED] wrote: I'm using psycopg2 to retrieve results from a rather large query (it returns 22m records); unsurprisingly this doesn't fit in memory all at once. What I'd like to achieve is something similar to a .NET data provider I have which allows

Re: Newsgroups and mailing lists (was Re: Slightly OT: Why all the spam?)

2007-05-25 Thread Gabriel Genellina
En Thu, 24 May 2007 21:53:24 -0300, Terry Reedy [EMAIL PROTECTED] escribió: Aahz [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | First of all, if you're accessing python-list as comp.lang.python, you're | accessing a newsgroup, *not* a mailing list. Secondly, c.l.py is an |

Re: just a bug (was: xml.dom.minidom: how to preserve CRLF's inside CDATA?)

2007-05-25 Thread sim.sim
On 25 май, 12:45, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: In [EMAIL PROTECTED], sim.sim wrote: Below the code that tryes to parse an well-formed xml, but it fails with error message: not well-formed (invalid token): line 3, column 85 How did you verified that it is well formed?

Re: optparse: list out entered values

2007-05-25 Thread Nirnimesh
On May 25, 3:07 am, Nirnimesh [EMAIL PROTECTED] wrote: I'm using optparse.OptionParser for parsing command line arguments. parser = optparse.OptionParser() parser.add_option(-x, --xample, help=example, default=nothing, dest=ex) options = parser.parse_args()[0] python example.py

Re: stdlib doc for logger.findCaller() needs update.

2007-05-25 Thread Steve Holden
Vinay Sajip wrote: On May 23, 12:05 pm, [EMAIL PROTECTED] wrote: The logger objects findCaller() method is returning a 3 element tuple instead of 2 two as documented in the 2.4.4 Python Library Reference .DocString is showing it correctly. I've updated the docs - the next 2.4.x release

Re: method override inside a module

2007-05-25 Thread Gabriel Genellina
En Fri, 25 May 2007 06:12:14 -0300, Fabrizio Pollastri [EMAIL PROTECTED] escribió: I am trying to override a method of a class defined into an imported module, but keeping intact the namespace of the imported module. The last part I don't get completely... For example, let suppose

How to do this in python with regular expressions

2007-05-25 Thread Jia Lu
Hi all I'm trying to parsing html with re module. html = TABLE BORDER=1 cellspacing=0 cellpadding=2 TR TH nowrapDATA1/THTH nowrapDATA2/HTTH nowrapDATA3/ HTTHDATA4/TH /TR TRTDDATA5/TDTDDATA6/TDTDDATA7/TDTDDATA8/TD/TR /TABLE I want to get DATA1-8 from that string.(DATA maybe not english

Re: Xml parser

2007-05-25 Thread Max M
ashish skrev: Hi All, I want to know weather is there any api available in python for parsing xml(XML parser) I have had very good succes with lxml -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Xml parser

2007-05-25 Thread ashish
Hi All, I want to know weather is there any api available in python for parsing xml(XML parser) Regards Ashish -- http://mail.python.org/mailman/listinfo/python-list

Re: Xml parser

2007-05-25 Thread Amit Khemka
On 5/24/07, ashish [EMAIL PROTECTED] wrote: Hi All, I want to know weather is there any api available in python for parsing xml(XML parser) Checkout cElementTree . Cheers, -- Amit Khemka -- onyomo.com Home Page: www.cse.iitd.ernet.in/~csd00377 Endless the world's turn, endless the

Re: How to do this in python with regular expressions

2007-05-25 Thread Thorsten Kampe
* Jia Lu (25 May 2007 04:51:35 -0700) I'm trying to parsing html with re module. [...] Can anyone tell me how to do it with regular expression in python? Just don't. Use an HTML parser like BeautifulSoup -- http://mail.python.org/mailman/listinfo/python-list

Re: Compiling python extension on amd64 for 32 bit

2007-05-25 Thread Andrew MacIntyre
Mathias Waack wrote: After switching my development environment to 64 bit I've got a problem with a python extension for a 32 bit application. {...} Ok, thats fine. So why is python complaining? Or even more interesting, what do I have to do to compile the code? Is the Python your toolchain

Re: just a bug

2007-05-25 Thread Carsten Haese
On Fri, 2007-05-25 at 04:03 -0700, sim.sim wrote: my CDATA-section contains only symbols in the range specified for Char: Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x1-#x10] filter(lambda x: ord(x) not in range(0x20, 0xD7FF), iMessage) That test is

Re: method override inside a module

2007-05-25 Thread Steve Holden
Fabrizio Pollastri wrote: Hello, I am trying to override a method of a class defined into an imported module, but keeping intact the namespace of the imported module. For example, let suppose import module_X and in module_X is defined something like class A:

Re: Newsgroups and mailing lists (was Re: Slightly OT: Why all the spam?)

2007-05-25 Thread Steve Holden
Gabriel Genellina wrote: En Thu, 24 May 2007 21:53:24 -0300, Terry Reedy [EMAIL PROTECTED] escribió: Aahz [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | First of all, if you're accessing python-list as comp.lang.python, you're | accessing a newsgroup, *not* a mailing

Re: just a bug (was: xml.dom.minidom: how to preserve CRLF's inside CDATA?)

2007-05-25 Thread harvey . thomas
On May 25, 12:03 pm, sim.sim [EMAIL PROTECTED] wrote: On 25 ÍÁÊ, 12:45, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: In [EMAIL PROTECTED], sim.sim wrote: Below the code that tryes to parse an well-formed xml, but it fails with error message: not well-formed (invalid token): line

Re: just a bug (was: xml.dom.minidom: how to preserve CRLF's inside CDATA?)

2007-05-25 Thread Richard Brodie
Neil Cerutti [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Web browsers are in the very business of reasonably rendering ill-formed mark-up. It's one of the things that makes implementing a browser take forever. ;) For HTML, yes. it accepts all sorts of garbage, like most

Re: just a bug (was: xml.dom.minidom: how to preserve CRLF's inside CDATA?)

2007-05-25 Thread Neil Cerutti
On 2007-05-25, Richard Brodie [EMAIL PROTECTED] wrote: Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] How did you verified that it is well formed? It appears to have a more fundamental problem, which is that it isn't correctly encoded (presumably

Re: just a bug (was: xml.dom.minidom: how to preserve CRLF's inside CDATA?)

2007-05-25 Thread Richard Brodie
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] How did you verified that it is well formed? It appears to have a more fundamental problem, which is that it isn't correctly encoded (presumably because the CDATA is truncated in mid-character). I'm surprised

Reading a file and resuming reading.

2007-05-25 Thread Karim Ali
Hi, Simple question. Is it possible in python to write code of the type: - while not eof - really want the EOF and not just an empty line! readline by line end while; - What I am using now is the implicit for loop after a readlines().

Re: Reading a file and resuming reading.

2007-05-25 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Karim Ali wrote: Simple question. Is it possible in python to write code of the type: - while not eof - really want the EOF and not just an empty line! readline by line end while; - while True: line =

Re: Reading a file and resuming reading.

2007-05-25 Thread Laszlo Nagy
Karim Ali wrote: Hi, Simple question. Is it possible in python to write code of the type: - while not eof - really want the EOF and not just an empty line! readline by line end while; - What I am using now is the implicit for

Re: just a bug

2007-05-25 Thread Maksim Kasimov
Carsten Haese: On Fri, 2007-05-25 at 04:03 -0700, sim.sim wrote: UnicodeDecodeError: 'utf8' codec can't decode bytes in position 176-177: invalid data iMessage[176:178] '\xd1]' And that's your problem. In general you can't just truncate a utf-8 encoded string anywhere and expect the

Re: Reading a file and resuming reading.

2007-05-25 Thread Hrvoje Niksic
Karim Ali [EMAIL PROTECTED] writes: - while not eof - really want the EOF and not just an empty line! readline by line end while; - for line in open_file: ... It will stop on EOF, not on empty line. But also, in case for one

Re: just a bug

2007-05-25 Thread Maksim Kasimov
[EMAIL PROTECTED] : You need to explicitly convert the string of UTF8 encoded bytes to a Unicode string before parsing e.g. unicodestring = unicode(encodedbytes, 'utf8') it is only a part of a string - not hole string, i've wrote it before. That meens that the content can not be converted to

extra xml header with ElementTree?

2007-05-25 Thread Tim Arnold
Hi, I'm using ElementTree which is wonderful. I have a need now to write out an XML file with these two headers: ?xml version=1.0 encoding=UTF-8 ? ?NLS TYPE=org.eclipse.help.toc? My elements have the root named tocbody and I'm using: newtree = ET.ElementTree(tocbody) newtree.write(fname) I

Re: just a bug

2007-05-25 Thread Mattia Gentilini
Richard Brodie ha scritto: For HTML, yes. it accepts all sorts of garbage, like most browsers; I've never, before now, seen it accept an invalid XML document though. It *could* depend on Content-Type. I've seen that Firefox treats XHTML as HTML (i.e. not trying to validate it) if you set

Re: How to do this in python with regular expressions

2007-05-25 Thread Mattia Gentilini
Thorsten Kampe ha scritto: I'm trying to parsing html with re module. Just don't. Use an HTML parser like BeautifulSoup Or HTMLParser/htmllib -- |\/|55: Mattia Gentilini e 55 = log2(che_palle_sta_storia) (by mezzo) |/_| ETICS project at CNAF, INFN, Bologna, Italy |\/| www.getfirefox.com

Re: How to do this in python with regular expressions

2007-05-25 Thread Mattia Gentilini
Thorsten Kampe ha scritto: I'm trying to parsing html with re module. Just don't. Use an HTML parser like BeautifulSoup Or HTMLParser/htmllib. of course you can mix those and re, it'll be easier than re only. -- |\/|55: Mattia Gentilini e 55 = log2(che_palle_sta_storia) (by mezzo) |/_| ETICS

Re: just a bug

2007-05-25 Thread Maksim Kasimov
Richard Brodie пишет: Neil Cerutti [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Web browsers are in the very business of reasonably rendering ill-formed mark-up. It's one of the things that makes implementing a browser take forever. ;) For HTML, yes. it accepts all sorts of

Why isn't this query working in python?

2007-05-25 Thread erikcw
Hi all, I'm trying to run the following query: amember_db = MySQLdb.connect(host=localhost, user=**, passwd=*, db=***) # create a cursor self.amember_cursor = amember_db.cursor() # execute SQL statement sql = SELECT payment_id FROM

Re: sockets, gethostname() changing

2007-05-25 Thread Alex Martelli
[EMAIL PROTECTED] wrote: ... and I'm not connected to the internet and I run the program, I get: my-names-computer.local When I'm connected to the internet, I get: dialup-9.999.999.999.dial9.xxx.level9.net That would bug me to high hell. A router in the middle would

Re: Why isn't this query working in python?

2007-05-25 Thread Dave Borne
I'm trying to run the following query: ... member_id=%s AND expire_date NOW() AND completed=1 AND (product_id Shouldn't you be using the bind variable '?' instead of '%s' ? (I'm asking because I'm not entirely sure how the execute command is doing the substitution) -Dave --

Re: just a bug

2007-05-25 Thread Jarek Zgoda
Maksim Kasimov napisał(a): 'utf8' codec can't decode bytes in position 176-177: invalid data iMessage[176:178] '\xd1]' And that's your problem. In general you can't just truncate a utf-8 encoded string anywhere and expect the result to be valid utf-8. The \xd1 at the very end of your CDATA

Re: Reading a file and resuming reading.

2007-05-25 Thread Karim Ali
Hrvoje Niksic [EMAIL PROTECTED] wrote: If you open the file in binary mode, you can easily keep track of the position in file: bytepos = 0 with file(filename) as f: for line in f: ... process line ... bytepos += len(line) If you need to restart the operation, simply seek to the

Re: drag and drop with wxPython ?

2007-05-25 Thread kyosohma
On May 25, 4:46 am, Stef Mientki [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On May 22, 10:00 am, stef [EMAIL PROTECTED] wrote: hello, I'm trying to move from Delphi to Python (move from MatLab to Python already succeeded, also thanks to this discussion group). From the

Re: Why isn't this query working in python?

2007-05-25 Thread erikcw
On May 25, 10:51 am, Dave Borne [EMAIL PROTECTED] wrote: I'm trying to run the following query: ... member_id=%s AND expire_date NOW() AND completed=1 AND (product_id Shouldn't you be using the bind variable '?' instead of '%s' ? (I'm asking because I'm not entirely sure how the execute

Re: Xml parser

2007-05-25 Thread kyosohma
On May 25, 7:04 am, Amit Khemka [EMAIL PROTECTED] wrote: On 5/24/07, ashish [EMAIL PROTECTED] wrote: Hi All, I want to know weather is there any api available in python for parsing xml(XML parser) Checkout cElementTree . Cheers, -- Amit Khemka -- onyomo.com Home

Re: webbrowser module bug?

2007-05-25 Thread kyosohma
On May 24, 5:03 pm, Ron Adam [EMAIL PROTECTED] wrote: Is anyone else having problems with the webbrowser module? Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type help, copyright, credits or license for more information. import

Re: just a bug

2007-05-25 Thread Maksim Kasimov
Jarek Zgoda: No, it is not a part of string. It's a part of byte stream, split in a middle of multibyte-encoded character. You cann't get only dot from small letter i and ask the parser to treat it as a complete i. ... i know it :)) can you propose something to solve it? ;) -- Maksim

Re: just a bug

2007-05-25 Thread Carsten Haese
On Fri, 2007-05-25 at 17:30 +0300, Maksim Kasimov wrote: I insist - my message is correct and not contradicts no any point of w3.org xml-specification. The fact that you believe this so strongly and we disagree just as strongly indicates a fundamental misunderstanding. Your fundamental

Re: dabo framework dependancies

2007-05-25 Thread daniel gadenne
Hi Paul, Peter, Uwe Thank to the three of you for your clear answers :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Why isn't this query working in python?

2007-05-25 Thread Carsten Haese
On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote: I'm trying to run the following query: ... member_id=%s AND expire_date NOW() AND completed=1 AND (product_id Shouldn't you be using the bind variable '?' instead of '%s' ? The parameter placeholder for MySQLdb is, indeed and

Re: extra xml header with ElementTree?

2007-05-25 Thread Gerard Flanagan
On May 25, 3:55 pm, Tim Arnold [EMAIL PROTECTED] wrote: Hi, I'm using ElementTree which is wonderful. I have a need now to write out an XML file with these two headers: ?xml version=1.0 encoding=UTF-8 ? ?NLS TYPE=org.eclipse.help.toc? My elements have the root named tocbody and I'm using:

Re: just a bug (done)

2007-05-25 Thread Maksim Kasimov
Carsten Haese: If you want to convey an arbitrary sequence of bytes as if they were characters, you need to pick a character encoding that can handle an arbitrary sequence of bytes. utf-8 can not do that. ISO-8859-1 can, but you need to specify the encoding explicitly. Observe what happens if

Re: extra xml header with ElementTree?

2007-05-25 Thread Tim Arnold
Gerard Flanagan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On May 25, 3:55 pm, Tim Arnold [EMAIL PROTECTED] wrote: Hi, I'm using ElementTree which is wonderful. I have a need now to write out an XML file with these two headers: ?xml version=1.0 encoding=UTF-8 ? ?NLS

Re: webbrowser module bug?

2007-05-25 Thread Ron Adam
[EMAIL PROTECTED] wrote: On May 24, 5:03 pm, Ron Adam [EMAIL PROTECTED] wrote: Is anyone else having problems with the webbrowser module? Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type help, copyright, credits or license for more

Proxying every function in a module

2007-05-25 Thread Josh West
Hello I've got a web application with the following structure: 1) module of 100 functions corresponding to user actions (e.g. update_profile(), organisations_list()) 2) a wsgi callable which maps urls to functions eg /organisations/list/?sort=date_created is mapped to

Proxying every function in a module

2007-05-25 Thread Josh West
Kind and wise fellows, I've got a web application with the following structure: 1) module of 100 functions corresponding to user actions (e.g. update_profile(), organisations_list()) 2) a wsgi callable which maps urls to functions eg /organisations/list/?sort=date_created is mapped to

Re: webbrowser module bug?

2007-05-25 Thread Steve Holden
Ron Adam wrote: [EMAIL PROTECTED] wrote: On May 24, 5:03 pm, Ron Adam [EMAIL PROTECTED] wrote: Is anyone else having problems with the webbrowser module? Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type help, copyright, credits or

Re: webbrowser module bug?

2007-05-25 Thread Brian van den Broek
Ron Adam said unto the world upon 05/25/2007 12:28 PM: [EMAIL PROTECTED] wrote: On May 24, 5:03 pm, Ron Adam [EMAIL PROTECTED] wrote: Is anyone else having problems with the webbrowser module? Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on

Re: sockets, gethostname() changing

2007-05-25 Thread Steve Holden
7stud wrote: [...] The strange thing is: the hostname and port in the output are not what I'm using in my server program: - import socket s = socket.socket() print made changes 2 host = socket.gethostname() #I'm not connected to the internet when I use this line print

Re: extra xml header with ElementTree?

2007-05-25 Thread Stefan Behnel
Tim Arnold wrote: Hi, I'm using ElementTree which is wonderful. I have a need now to write out an XML file with these two headers: ?xml version=1.0 encoding=UTF-8 ? ?NLS TYPE=org.eclipse.help.toc? My elements have the root named tocbody and I'm using: newtree = ET.ElementTree(tocbody)

Re: sockets, gethostname() changing

2007-05-25 Thread 7stud
For local testing it is *much* easier to have your client and server use IP address 127.0.0.1 According to my book, an address is a tuple of the form (hostname, port), so I didn't know what you meant by using 127.0.0.1 as the address. I played around with it, and using the tuple (127.0.0.1,

Re: Shared Memory Space - Accross Apps Network

2007-05-25 Thread Irmen de Jong
Hendrik van Rooyen wrote: Just to get the ball rolling, I'd suggest two things: Pyro -http://pyro.sf.net This is good advice, if you have the power to run it. What do you mean exactly by the power to run it? --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Proxying every function in a module

2007-05-25 Thread Steve Holden
Josh West wrote: Kind and wise fellows, [...] Please see my separate reply with the same subject line but in a new thread. That reply explains *why* it's in a new thread. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd

Re: webbrowser module bug?

2007-05-25 Thread Ron Adam
Brian van den Broek wrote: Ron Adam said unto the world upon 05/25/2007 12:28 PM: [EMAIL PROTECTED] wrote: On May 24, 5:03 pm, Ron Adam [EMAIL PROTECTED] wrote: Is anyone else having problems with the webbrowser module? Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) [GCC 4.1.2

Large Amount of Data

2007-05-25 Thread Jack
I need to process large amount of data. The data structure fits well in a dictionary but the amount is large - close to or more than the size of physical memory. I wonder what will happen if I try to load the data into a dictionary. Will Python use swap memory or will it fail? Thanks. --

Re: Proxying every function in a module

2007-05-25 Thread Steve Holden
Kind and wise fellows, I've got a web application with the following structure: 1) module of 100 functions corresponding to user actions (e.g. update_profile(), organisations_list()) 2) a wsgi callable which maps urls to functions eg /organisations/list/?sort=date_created is mapped to

Listbox - Active index

2007-05-25 Thread rahulnag22
Hi, I am using a listbox in selectmode = MULTIPLE, I can get the current selected item in the listbox from index = ACTIVE , but is there a way to convert this ACTIVE to get the current selection index as a number. For multiple selectmode listboxes it returns a tuple of selected indexes, so I

Re: Large Amount of Data

2007-05-25 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Jack wrote: I need to process large amount of data. The data structure fits well in a dictionary but the amount is large - close to or more than the size of physical memory. I wonder what will happen if I try to load the data into a dictionary. Will Python use swap

Re: Large Amount of Data

2007-05-25 Thread Jack
Thanks for the replies! Database will be too slow for what I want to do. Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In [EMAIL PROTECTED], Jack wrote: I need to process large amount of data. The data structure fits well in a dictionary but the amount

Re: optparse: list out entered values

2007-05-25 Thread Steven Bethard
Nirnimesh wrote: On May 25, 3:07 am, Nirnimesh [EMAIL PROTECTED] wrote: I'm using optparse.OptionParser for parsing command line arguments. parser = optparse.OptionParser() parser.add_option(-x, --xample, help=example, default=nothing, dest=ex) options = parser.parse_args()[0]

ICMLA 2007: CALL FOR PAPERS

2007-05-25 Thread icmla
ICMLA 2007: CALL FOR PAPERS The Sixth International Conference on Machine Learning and Applications ICMLA 2007 December 13-15, 2007 Cincinnati, OH, USA

Re: Proxying every function in a module

2007-05-25 Thread Josh West
First off, don't attempt to start a new thread by replying to a previous one. Many newsreaders will merge the two, confusing the hell out of everyone and generally not helping. Ahh, yes. I see what you mean. Explains why it didn't appear the first time I posted (until later..). Sorry

Re: webbrowser module bug?

2007-05-25 Thread Ron Adam
Steve Holden wrote: Ron Adam wrote: [EMAIL PROTECTED] wrote: On May 24, 5:03 pm, Ron Adam [EMAIL PROTECTED] wrote: Is anyone else having problems with the webbrowser module? Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type help,

Re: Large Amount of Data

2007-05-25 Thread Matimus
On May 25, 10:50 am, Jack [EMAIL PROTECTED] wrote: I need to process large amount of data. The data structure fits well in a dictionary but the amount is large - close to or more than the size of physical memory. I wonder what will happen if I try to load the data into a dictionary. Will

Re: Proxying every function in a module

2007-05-25 Thread Steve Holden
Josh West wrote: First off, don't attempt to start a new thread by replying to a previous one. Many newsreaders will merge the two, confusing the hell out of everyone and generally not helping. Ahh, yes. I see what you mean. Explains why it didn't appear the first time I posted

Re: webbrowser module bug?

2007-05-25 Thread Paul Boddie
On 25 May, 00:03, Ron Adam [EMAIL PROTECTED] wrote: Is anyone else having problems with the webbrowser module? Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type help, copyright, credits or license for more information. import

Re: Newsgroups and mailing lists (was Re: Slightly OT: Why all thespam?)

2007-05-25 Thread Terry Reedy
Steve Holden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | I *did* try to explain all this a week or two ago. Did I not make myself clear? I could ask the same. Quoting from that post: | All I am saying is that it's difficult to catch *everything* when so | much of the content

Re: stdlib doc for logger.findCaller() needs update.

2007-05-25 Thread Vinay Sajip
On May 25, 12:27 pm, Steve Holden [EMAIL PROTECTED] wrote: Is a further 2.4 release planned? I'd have thought that unless a security issue appears the answer is likely to be no. You never know - and it didn't take long to commit the change to release24-maint, so why not?! Regards, Vinay

csv.reader length?

2007-05-25 Thread cjl
P: Stupid question: reader = csv.reader(open('somefile.csv')) for row in reader: do something Any way to determine the length of the reader (the number of rows) before iterating through the rows? -CJL -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >