Re: Problem with -3 switch

2009-01-12 Thread Steve Holden
Carl Banks wrote: > On Jan 9, 6:11 pm, John Machin wrote: >> On Jan 10, 6:58 am, Carl Banks wrote: [...] >> Steve & Cliff are talking about the rather small subset of Python that >> is not only valid syntax in both 2.x and 3.x but also has the same >> meaning in 2.x and 3.x. > > That would be a

Re: Is negative seek() from EOF of a GzipFile supported on Python 2.5.2 ?

2009-01-12 Thread Steve Holden
Gabriel Genellina wrote: > En Sun, 11 Jan 2009 08:12:27 -0200, Barak, Ron > escribió: > >> I googled a bit, and found http://bugs.python.org/issue1355023. >> It seems that this patch implemented fuller seek() for GzipFile around >> November 2006 (including whence==2). >> Do I misunderstand and th

Re: Object help

2009-01-12 Thread Steve Holden
James Mills wrote: > On Mon, Jan 12, 2009 at 9:49 AM, killsto wrote: >> Thanks. That makes sense. It helps a lot. Although, you spelled color >> wrong :P. > > color > colour > > They are both correct depending on what > country you come from :) > They are also both incorrect, depending which co

Re: Problem with -3 switch

2009-01-12 Thread Carl Banks
On Jan 12, 12:32 am, John Machin wrote: > On Jan 12, 12:23 pm, Carl Banks wrote: > > > > > On Jan 9, 6:11 pm, John Machin wrote: > > > > On Jan 10, 6:58 am, Carl Banks wrote: > > > > > On Jan 9, 12:36 pm, "J. Cliff Dyer" wrote: > > > > > > On Fri, 2009-01-09 at 13:13 -0500, Steve Holden wrote:

Bug in python [was: Fatal Python error: ceval: tstate mix-up]

2009-01-12 Thread Laszlo Nagy
Laszlo Nagy wrote: Meanwhile I'm trying to turn off threads in that program one by one. I just got this new type of error: Fatal Python error: PyThreadState_Delete: invalid tstate After some days, there are now answers to my question. I guess this is because nobody knows the answer. I think I

Re: ActiveState Python Together with "Regular" Python) ((DLE)

2009-01-12 Thread W. eWatson
John Machin wrote: On Jan 12, 2:00 pm, "W. eWatson" wrote: I installed "Python" 2.5 a few months ago with IDLE, and decided I'd like to try windowpy from ActiveState. Is having both of these installed going to cause me trouble? What is "windowpy from ActiveState"? If you mean you wanted to tr

debugging ignored exceptions at cleanup

2009-01-12 Thread Michele Simionato
In some conditions (typically with threads, __del__ methods, etc) the cleanup mechanism of Python gets in trouble and some exceptions are not raised but just printed on stderr. I have an application using Paste and when I run the tests I get some annoying ignored exceptions during cleanup. Running

Re: ActiveState Python Together with "Regular" Python) ((DLE)

2009-01-12 Thread John Machin
On Jan 12, 9:16 pm, "W. eWatson" wrote: > John Machin wrote: > > On Jan 12, 2:00 pm, "W. eWatson" wrote: > >> I installed "Python" 2.5 a few months ago with IDLE, and decided I'd like > >> to > >> try windowpy from ActiveState. Is having both of these installed going to > >> cause me trouble? >

Re: hlep: a text search and rename question

2009-01-12 Thread James Stroud
sensen wrote: matter description: when a use an tools to do the ape to flac convert, i can use the cue file attached with ape, but the problem is the converted flac file don't name by the title in the cue file but like Track_1.flac, Track_2.flac ... , so i want to write a script to do this work,

Re: hlep: a text search and rename question

2009-01-12 Thread James Stroud
James Stroud wrote: cue = iter(open('CDImage.cue').readlines()) It just occurred to me that this could simply be: cue = open('CDImage.cue') James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com -- http://mail.python

Re: change only the nth occurrence of a pattern in a string

2009-01-12 Thread Antoon Pardon
On 2008-12-31, TP wrote: > Hi everybody, > > I would like to change only the nth occurence of a pattern in a string. The > problem with "replace" method of strings, and "re.sub" is that we can only > define the number of occurrences to change from the first one. > v="coucou" v.replace("o

Re: Problem with -3 switch

2009-01-12 Thread John Machin
On Jan 12, 7:29 pm, Carl Banks wrote: > On Jan 12, 12:32 am, John Machin wrote: > > > > > > > On Jan 12, 12:23 pm, Carl Banks wrote: > > > > On Jan 9, 6:11 pm, John Machin wrote: > > > > > On Jan 10, 6:58 am, Carl Banks wrote: > > > > > I expect that it'd be a PITA in some cases to use the tr

Re: Unbinding Tkinter default bindings for Listbox

2009-01-12 Thread James Stroud
Roger wrote: Hi Everyone, I have a behavior associated with a default binding with Tkinter Listbox that I want to get rid of but I can't no matter if I return "break" on the binding or unbind it directly. If you have a Listbox where the bounding box is not completely revealed in the window that

Re: Unbinding Tkinter default bindings for Listbox

2009-01-12 Thread James Stroud
James Stroud wrote: py> b.tk.call('bind', 'Listbox', '', _) You want b.tk.call('bind', 'Listbox', '', "") of course. James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com -- http://mail.python.org/mailman/listinfo/py

Python logging rollover

2009-01-12 Thread Kottiyath
Hi, I want to do a log rollover - preferably based on day; size is also Ok. I checked logging.TimedRotatingFileHandler, but I am not sure whether it will suit my purpose. Mine is a desktop application. So, everytime the machine starts, the whole logging system is reinitialized. So, in such a case,

Re: hlep: a text search and rename question

2009-01-12 Thread sensen
On Jan 12, 8:17 pm, James Stroud wrote: > James Stroud wrote: > > cue = iter(open('CDImage.cue').readlines()) > > It just occurred to me that this could simply be: > > cue = open('CDImage.cue') > > James > > -- > James Stroud > UCLA-DOE Institute for Genomics and Proteomics > Box 951570 > Los Ange

Re: Problem with -3 switch

2009-01-12 Thread Christian Heimes
John Machin schrieb: > And therefore irrelevant. No, Carl is talking about the very same issue. > I would like to hear from someone who has actually started with > working 2.x code and changed all their text-like "foo" to > u"foo" [except maybe unlikely suspects like open()'s mode arg]: > * how m

Re: Implementing file reading in C/Python

2009-01-12 Thread Sion Arrowsmith
Grant Edwards wrote: >On 2009-01-09, Sion Arrowsmith wrote: >> Grant Edwards wrote: >>>If I were you, I'd try mmap()ing the file instead of reading it >>>into string objects one chunk at a time. >> You've snipped the bit further on in that sentence where the >> OP says that the file of interes

Re: Problem with -3 switch

2009-01-12 Thread John Machin
On Jan 12, 11:05 pm, Christian Heimes wrote: > John Machin schrieb: > > > And therefore irrelevant. > > No, Carl is talking about the very same issue. > > > I would like to hear from someone who has actually started with > > working 2.x code and changed all their text-like "foo" to > > u"foo" [exc

Re: Python 2.6.1 @executable_path

2009-01-12 Thread googler . 1 . webmaster
Hi! Woow, thanks. The unix command install_name_tool solved my problem. Thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Encoding Title mail

2009-01-12 Thread Andrea Reginato
Hi to everybody, I'm trying to use libgmail version 0.1.9, to read some mails from a google account and save the attached files. All works fine, but when a tile has some letters with accents (like èùàòì) I read a string like this. =?ISO-8859-1?Q?=F2=E0=F9+=E8=EC'_0987654321_\?= =?ISO-8859-1?Q? _=E

strange dict issue

2009-01-12 Thread Heston James - Cold Beans
Ok, this feels like a horribly noobish question to ask guys but I can't figure this one out. I have code which looks like this: print this_config[1] this_adapter_config["name"] = this_config[1]["NAME"] Now, the print statement gives me

Re: Implementing file reading in C/Python

2009-01-12 Thread sturlamolden
On Jan 9, 6:41 pm, Sion Arrowsmith wrote: > You've snipped the bit further on in that sentence where the OP > says that the file of interest is 2GB. Do you still want to try > mmap'ing it? Python's mmap object does not take an offset parameter. If it did, one could mmap smaller portions of the f

Re: Implementing file reading in C/Python

2009-01-12 Thread Sion Arrowsmith
In case the cancel didn't get through: Sion Arrowsmith wrote: >Grant Edwards wrote: >>2GB should easily fit within the process's virtual memory >>space. >Assuming you're in a 64bit world. Me, I've only got 2GB of address >space available to play in -- mmap'ing all of it out of the question. A

Re: strange dict issue

2009-01-12 Thread Benjamin Kaplan
On Mon, Jan 12, 2009 at 7:24 AM, Heston James - Cold Beans < heston.ja...@coldbeans.co.uk> wrote: > Ok, this feels like a horribly noobish question to ask guys but I can't > figure this one out. > > > > I have code which looks like this: > > > > print this_config[1] > > > >

Re: strange dict issue

2009-01-12 Thread Gary M. Josack
Heston James - Cold Beans wrote: Ok, this feels like a horribly noobish question to ask guys but I can’t figure this one out. I have code which looks like this: print this_config[1] this_adapter_config[/"name"/] = this_config[1][/"NAME"/] Now, the print statement gives me the following: {

Re: Problem with -3 switch

2009-01-12 Thread Christian Heimes
>> Perhaps you also like to hear from a developer who has worked on Python >> 3.0 itself and who has done lots of work with internationalized >> applications. If you want to get it right you must >> >> * decode incoming text data to unicode as early as possible >> * use unicode for all internal tex

Re: Encoding Title mail

2009-01-12 Thread Marc 'BlackJack' Rintsch
On Mon, 12 Jan 2009 04:32:35 -0800, Andrea Reginato wrote: > Hi to everybody, I'm trying to use libgmail version 0.1.9, to read some > mails from a google account and save the attached files. All works fine, > but when a tile has some letters with accents (like èùàòì) I read a > string like this.

RE: strange dict issue

2009-01-12 Thread Heston James - Cold Beans
Gary, Ben, Thanks for your replies, that makes perfect sense. This is a dict generated by the ZSI web service library and looks different to what I expect. :-( I'll work on your suggestions, thanks again for your help. Heston -- http://mail.python.org/mailman/listinfo/python-list

Python tricks

2009-01-12 Thread RajNewbie
Hi, My code has a lot of while loops of the following format: while True: ... if : break The danger with such a code is that it might go to an infinite loop - if the never occurs. Is there a way - a python trick - to have a check such that if the loop goes for more than x nu

Re: Implementing file reading in C/Python

2009-01-12 Thread sturlamolden
On Jan 12, 1:52 pm, Sion Arrowsmith wrote: > And today's moral is: try it before posting. Yeah, I can map a 2GB > file no problem, complete with associated 2GB+ allocated VM. The > addressing is clearly not working how I was expecting it too. The virtual memory space of a 32 bit process is 4 GB.

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-12 Thread bieffe62
On 12 Gen, 00:02, Paul Rubin wrote: > Carl Banks writes: > > and where it was manipulated for that matter. > > > This criticism is completely unfair.  Instance variables have to be > > manipulated somewhere, and unless your object is immutable, that is > > going to h

Re: strange dict issue

2009-01-12 Thread Ferdinand Sousa
James First off, the computer is always right :-) > {'value': 'Route66', 'key': 'NAME'} > > > > Yet when the second line of my code throws an error saying the key 'NAME' > doesn't exist. > If you look carefully the key NAME indeed does not exist. The dictionary contains 2 key-value pairs. This

Re: Implementing file reading in C/Python

2009-01-12 Thread Hrvoje Niksic
sturlamolden writes: > On Jan 9, 6:41 pm, Sion Arrowsmith > wrote: > >> You've snipped the bit further on in that sentence where the OP >> says that the file of interest is 2GB. Do you still want to try >> mmap'ing it? > > Python's mmap object does not take an offset parameter. If it did, one >

Re: Python tricks

2009-01-12 Thread Ben Finney
RajNewbie writes: > Could someone chip in with other suggestions? Set up an iterable that will end under the right conditions. Then, iterate over that with ‘for foo in that_iterable’. This idiom is usually far more expressive than any tricks with ‘while’ loops and ‘break’ statements. For tools

Re: Problem with -3 switch

2009-01-12 Thread John Machin
On Jan 13, 12:06 am, Christian Heimes wrote: > >> Perhaps you also like to hear from a developer who has worked on Python > >> 3.0 itself and who has done lots of work with internationalized > >> applications. If you want to get it right you must > > >> * decode incoming text data to unicode as ea

Re: hlep: a text search and rename question

2009-01-12 Thread sensen
both above works well, but a problem is renamed file is without filename extension. only change to the title. for example, the origin file is track_1.flac, after run the script i want it to for example, White Flag.flac, but now it change to White Flag without extension. could you do a favor to f

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-12 Thread Paul Rubin
bieff...@gmail.com writes: > >    class Foo (DynamicAttributes, object): pass > > > You cannot do that, but you can establish a fixed set of attributes by > defining the __slot__ class variable. That is not what __slot__ is for. -- http://mail.python.org/mailman/listinfo/python-list

Re: are there some special about '\x1a' symbol

2009-01-12 Thread sim.sim
On 10 янв, 23:40, John Machin wrote: > On Jan 11, 2:45 am, "sim.sim" wrote: > > > > > Hi all! > > > I had touch with some different python behavior: I was tried to write > > into a file a string with the '\x1a' symbol, and for FreeBSD system, > > it gives expected result: > > > >>> open("test", "

Re: Python tricks

2009-01-12 Thread Tim Chase
My code has a lot of while loops of the following format: while True: ... if : break The danger with such a code is that it might go to an infinite loop - if the never occurs. Is there a way - a python trick - to have a check such that if the loop goes for more than x numbe

Re: are there some special about '\x1a' symbol

2009-01-12 Thread John Machin
On Jan 13, 12:45 am, "sim.sim" wrote: > On 10 ÑÎ×, 23:40, John Machin wrote: > > > > > > > On Jan 11, 2:45šam, "sim.sim" wrote: > > > > Hi all! > > > > I had touch with some different python behavior: I was tried to write > > > into a file a string with the '\x1a' symbol, and for FreeBSD system,

Re: Python tricks

2009-01-12 Thread RajNewbie
On Jan 12, 6:51 pm, Tim Chase wrote: > >    My code has a lot of while loops of the following format: > >    while True: > >      ... > >      if : break > > >    The danger with such a code is that it might go to an infinite loop > > - if the never occurs. > >    Is there a way - a python trick

Re: Python tricks

2009-01-12 Thread Paul Rubin
RajNewbie writes: >I do understand that we can use the code like - >i = 0 >while True: > i++ > if i > 200: raise infinite_Loop_Exception > ... > if : break > >But I am not very happy with this code for 3 reasons I prefer: from itertools import count fo

Re: mod_python: delay in files changing after alteration

2009-01-12 Thread psaff...@googlemail.com
On 6 Jan, 23:31, Graham Dumpleton wrote: > Thus, any changes to modules/packages installed on sys.path require a > full restart of Apache to ensure they are loaded by all Apache child > worker processes. > That will be it. I'm pulling in some libraries of my own from elsewhere, which are still b

Re: Python tricks

2009-01-12 Thread John Machin
On Jan 13, 12:51 am, Tim Chase took a walk on the OT side: > > Could someone chip in with other suggestions? > > As an aside:  the phrase is "chime in"[1] (to volunteer > suggestions) "Chip in"[2] usually involves contributing money to > a common fund ("care to chip in $10 for Sally's wedding gif

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-12 Thread Roy Smith
In article <7x1vv83afq@ruckus.brouhaha.com>, Paul Rubin wrote: > bieff...@gmail.com writes: > > >    class Foo (DynamicAttributes, object): pass > > > > > You cannot do that, but you can establish a fixed set of attributes by > > defining the __slot__ class vari

Egg deinstallation

2009-01-12 Thread mk
Hello everyone, I googled and googled and can't seem to find the definitive answer: how to *properly* deinstall egg? Just delete the folder and/or .py and .pyc files from Lib/site-packages? Would that break anything in Python installation or not? Regards, mk -- http://mail.python.org/mailm

subprocess.Popen stalls

2009-01-12 Thread psaff...@googlemail.com
I'm building a bioinformatics application using the ipcress tool: http://www.ebi.ac.uk/~guy/exonerate/ipcress.man.html I'm using subprocess.Popen to execute ipcress, which takes a group of files full of DNA sequences and returns some analysis on them. Here's a code fragment: cmd = "/usr/bin/ipcr

Re: Egg deinstallation

2009-01-12 Thread Diez B. Roggisch
mk wrote: > Hello everyone, > > I googled and googled and can't seem to find the definitive answer: how > to *properly* deinstall egg? Just delete the folder and/or .py and .pyc > files from Lib/site-packages? Would that break anything in Python > installation or not? It depends on how you insta

Re: hlep: a text search and rename question

2009-01-12 Thread sensen
On Jan 12, 10:41 pm, sensen wrote: > both above works well, but a problem is renamed file is without > filename extension. > > only change to the title. > > for example, the origin file is track_1.flac, after run the script i > want it to for example, White Flag.flac, but now it change to White >

Re: subprocess.Popen stalls

2009-01-12 Thread Jean-Paul Calderone
On Mon, 12 Jan 2009 06:37:35 -0800 (PST), "psaff...@googlemail.com" wrote: I'm building a bioinformatics application using the ipcress tool: http://www.ebi.ac.uk/~guy/exonerate/ipcress.man.html I'm using subprocess.Popen to execute ipcress, which takes a group of files full of DNA sequences a

Re: Egg deinstallation

2009-01-12 Thread mk
Diez B. Roggisch wrote: Thanks, Diez. -- http://mail.python.org/mailman/listinfo/python-list

Compressed vs uncompressed eggs

2009-01-12 Thread mk
Hello everyone, Are there *good* reasons to use uncompressed eggs? Is there a, say, performance penalty in using compressed eggs? Regards, mk -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess.Popen stalls

2009-01-12 Thread mk
psaff...@googlemail.com wrote: p = Popen(cmd, shell=True, bufsize=100, stdout=PIPE, stderr=PIPE) output = p.stdout.read() Better use communicate() method: standardoutputstr, standarderrorstr = subprocess.communicate(...) Never had any problem with subprocesses when using subprocess module in

Re: Compressed vs uncompressed eggs

2009-01-12 Thread Diez B. Roggisch
mk wrote: > Hello everyone, > > Are there *good* reasons to use uncompressed eggs? Plenty. Mostly that some things simply don't work in compressed eggs. See the zipsafe-flag in setuptools-docs. > Is there a, say, performance penalty in using compressed eggs? Not that it matters I'd say - only

Re: ActiveState Python Together with "Regular" Python) ((DLE)

2009-01-12 Thread W. eWatson
John Machin wrote: On Jan 12, 9:16 pm, "W. eWatson" wrote: John Machin wrote: On Jan 12, 2:00 pm, "W. eWatson" wrote: I installed "Python" 2.5 a few months ago with IDLE, and decided I'd like to try windowpy from ActiveState. Is having both of these installed going to cause me trouble? What

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-12 Thread bieffe62
On 12 Gen, 14:45, Paul Rubin wrote: > bieff...@gmail.com writes: > > >    class Foo (DynamicAttributes, object): pass > > > You cannot do that, but you can establish a fixed set of attributes by > > defining the __slot__ class variable. > > That is not what __slot__ i

Re: Implementing file reading in C/Python

2009-01-12 Thread Grant Edwards
On 2009-01-12, Sion Arrowsmith wrote: > Grant Edwards wrote: >>On 2009-01-09, Sion Arrowsmith wrote: >>> Grant Edwards wrote: If I were you, I'd try mmap()ing the file instead of reading it into string objects one chunk at a time. >>> You've snipped the bit further on in that sentence

Re: subprocess.Popen stalls

2009-01-12 Thread psaff...@googlemail.com
On 12 Jan, 15:33, mk wrote: > > Better use communicate() method: > Oh yes - it's right there in the documentation. That worked perfectly. Many thanks, Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementing file reading in C/Python

2009-01-12 Thread Grant Edwards
On 2009-01-12, Sion Arrowsmith wrote: > In case the cancel didn't get through: > > Sion Arrowsmith wrote: >>Grant Edwards wrote: >>>2GB should easily fit within the process's virtual memory >>>space. >>Assuming you're in a 64bit world. Me, I've only got 2GB of address >>space available to play

Re: subprocess.Popen stalls

2009-01-12 Thread mk
psaff...@googlemail.com wrote: On 12 Jan, 15:33, mk wrote: Better use communicate() method: Oh yes - it's right there in the documentation. That worked perfectly. What's also in the docs and I did not pay attention to before: Note The data read is buffered in memory, so do not use this m

Re: Compressed vs uncompressed eggs

2009-01-12 Thread Christian Heimes
> Is there a, say, performance penalty in using compressed eggs? To the contrary, it can be faster to import from a zip file than from the file system. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: BadZipfile "file is not a zip file"

2009-01-12 Thread webcomm
If anyone's interested, here are my django views... from django.shortcuts import render_to_response from django.http import HttpResponse from xml.etree.ElementTree import ElementTree import urllib, base64, subprocess def get_data(request): service_url = 'http://www.something.com/webservices/

read a password protected xls file

2009-01-12 Thread thomas . steffen75
Hello, how can I read (and parse) a password protected xls file, perhaps with the package xlrd? Thanks for your hints, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding Title mail

2009-01-12 Thread Andrea Reginato
On Jan 12, 2:06 pm, Marc 'BlackJack' Rintsch wrote: > On Mon, 12 Jan 2009 04:32:35 -0800, Andrea Reginato wrote: > > Hi to everybody, I'm trying to use libgmail version 0.1.9, to read some > > mails from a google account and save the attached files. All works fine, > > but when a tile has some let

Re: BadZipfile "file is not a zip file"

2009-01-12 Thread Chris Mellon
On Sat, Jan 10, 2009 at 1:32 PM, webcomm wrote: > On Jan 9, 7:33 pm, John Machin wrote: >> It is not impossible for a file with dummy data to have been >> handcrafted or otherwise produced by a process different to that used >> for a real-data file. > > I knew it was produced by the same process,

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-12 Thread Marc 'BlackJack' Rintsch
On Mon, 12 Jan 2009 07:42:47 -0800, bieffe62 wrote: > On 12 Gen, 14:45, Paul Rubin wrote: >> bieff...@gmail.com writes: >> > >    class Foo (DynamicAttributes, object): pass >> >> > You cannot do that, but you can establish a fixed set of attributes >> > by defining

Re: Python logging rollover

2009-01-12 Thread Scott David Daniels
Kottiyath wrote: Hi, I want to do a log rollover I tested it with 'midnight' option, but it did not work as I expected. Please google "smart questions". All I can conclude from your message is that your expectations are wrong. It is not enough to tell us you are confused. You need to sh

VTK in python

2009-01-12 Thread Almar Klein
Hi all, I want to use the Visualisation ToolKit from python. However, I cannot find an easy way to install it. Of course, I could download the source, use CMake to build and VS to compile it, but... yeah, that takes a lot of time and will probably not work the first time... I noticed that with V

Re: Bug in python [was: Fatal Python error: ceval: tstate mix-up]

2009-01-12 Thread Terry Reedy
Laszlo Nagy wrote: Laszlo Nagy wrote: Meanwhile I'm trying to turn off threads in that program one by one. I just got this new type of error: Fatal Python error: PyThreadState_Delete: invalid tstate After some days, there are now answers to my question. I guess this is because nobody knows th

Re: Bug in python [was: Fatal Python error: ceval: tstate mix-up]

2009-01-12 Thread Terry Reedy
Terry Reedy wrote: Laszlo Nagy wrote: Laszlo Nagy wrote: Meanwhile I'm trying to turn off threads in that program one by one. I just got this new type of error: Fatal Python error: PyThreadState_Delete: invalid tstate After some days, there are now answers to my question. I guess this is bec

Re: Python tricks

2009-01-12 Thread Scott David Daniels
RajNewbie wrote: On Jan 12, 6:51 pm, Tim Chase wrote: [a perfectly fine reply which is how I'd solve it] >> RajNewbie wrote: ... The solution that I had in mind is: while True: ... if : break if inifinte_loop(): raise infiinte_loop_exception Wherein infinite_loop is a ge

Simple CGI-XMLRPC failure

2009-01-12 Thread Mike MacHenry
I am having a difficult time understanding why my very simple CGI-XMLRPC test isn't working. I created a server to export two functions, the built-in function "pow" and my own identity function "i". I run a script to call both of them and the "pow" work fine but the "i" gives me an error that says

Re: Egg deinstallation

2009-01-12 Thread Ned Deily
In article <6t139nf8ip4...@mid.uni-berlin.de>, "Diez B. Roggisch" wrote: > mk wrote: > > I googled and googled and can't seem to find the definitive answer: how > > to *properly* deinstall egg? Just delete the folder and/or .py and .pyc > > files from Lib/site-packages? Would that break anything

Re: Unbinding Tkinter default bindings for Listbox

2009-01-12 Thread Roger
On Jan 12, 6:31 am, James Stroud wrote: > James Stroud wrote: > > py> b.tk.call('bind', 'Listbox', '', _) > > You want b.tk.call('bind', 'Listbox', '', "") of course. > > James > > -- > James Stroud > UCLA-DOE Institute for Genomics and Proteomics > Box 951570 > Los Angeles, CA 90095 > > http://ww

python3.0 MySQLdb

2009-01-12 Thread gert
I need something to connect to a database, preferably mysql, that works in python3.0 please. -- http://mail.python.org/mailman/listinfo/python-list

trying to modify locals() dictionary

2009-01-12 Thread TP
Hi everybody, I try to modify locals() as an exercise. According to the context (function or __main__), it works differently (see below). Why? Thanks Julien def try_to_modify_locals( locals_ ): locals_[ "a" ] = 2 print "locals_[ 'a' ]=", locals_[

Re: trying to modify locals() dictionary

2009-01-12 Thread Christian Heimes
TP schrieb: > Hi everybody, > > I try to modify locals() as an exercise. > According to the context (function or __main__), it works differently (see > below). Why? Thanks Because http://docs.python.org/library/functions.html#locals Warning The contents of this dictionary should not be modified

Slow network?

2009-01-12 Thread Laszlo Nagy
Hi All, To make the long story short, I have a toy version of an ORB being developed, and the biggest problem is slow network speed over TCP/IP. There is an object called 'endpoint' on both sides, with incoming and outgoing message queues. This endpoint object has a socket assigned, with n

Re: Problem with -3 switch

2009-01-12 Thread Christian Heimes
> I say again, show me a case of working 2.5 code where prepending u to > an ASCII string constant that is intended to be used in a text context > is actually worth the keystrokes. Eventually you'll learn it the hard way. *sigh* Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating new instances of subclasses.

2009-01-12 Thread J. Clifford Dyer
On Fri, 2009-01-09 at 10:46 -0800, Dennis Lee Bieber wrote: > On Wed, 07 Jan 2009 11:38:29 -0500, "J. Cliff Dyer" > declaimed the following in comp.lang.python: > > > I want to be able to create an object of a certain subclass, depending > > on the argument given to the class constructor. > > >

Re: trying to modify locals() dictionary

2009-01-12 Thread Albert Hopkins
On Mon, 2009-01-12 at 19:51 +0100, TP wrote: > Hi everybody, > > I try to modify locals() as an exercise. > According to the context (function or __main__), it works differently (see > below). Why? Thanks > > Julien Per the locals() documentation @ http://docs.python.org/library/functions.html

Re: python3.0 MySQLdb

2009-01-12 Thread Daniel Fetchinson
> I need something to connect to a database, preferably mysql, that > works in python3.0 please. And your question is? -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Slow network?

2009-01-12 Thread Chris Mellon
On Mon, Jan 12, 2009 at 1:13 PM, Laszlo Nagy wrote: > > Hi All, > > To make the long story short, I have a toy version of an ORB being > developed, and the biggest problem is slow network speed over TCP/IP. > > There is an object called 'endpoint' on both sides, with incoming and > outgoing messa

efficient interval containment lookup

2009-01-12 Thread Per Freem
hello, suppose I have two lists of intervals, one significantly larger than the other. For example listA = [(10, 30), (5, 25), (100, 200), ...] might contain thousands of elements while listB (of the same form) might contain hundreds of thousands or millions of elements. I want to count how many i

Re: Slow network?

2009-01-12 Thread MRAB
Chris Mellon wrote: On Mon, Jan 12, 2009 at 1:13 PM, Laszlo Nagy wrote: Hi All, To make the long story short, I have a toy version of an ORB being developed, and the biggest problem is slow network speed over TCP/IP. There is an object called 'endpoint' on both sides, with incoming and outgo

Re: Slow network?

2009-01-12 Thread Laszlo Nagy
It is very likely that nodelay is actually hurting you here. Using the select module and doing non-blocking IO will be faster than using threads for this as well. These sockets are non blocking and I'm using select.select indeed. Here is how it is implemented: def read_data(self,size): re

Re: Slow network?

2009-01-12 Thread Laszlo Nagy
You might also want to replace those 'pass' statements when smartqueue is empty or full with time.sleep() to avoid busy waiting. It won't do busy waiting, because read_str and write_str are using select.select and they will block without using CPU time, until data becomes available to read/wri

Re: Slow network?

2009-01-12 Thread Laszlo Nagy
You might also want to replace those 'pass' statements when smartqueue is empty or full with time.sleep() to avoid busy waiting. I misunderstood your post, sorry. My smartqueue class has a timeout parameter, and it can block for an item, or raise the Full/Empty exception after timeout exceeded

Re: Slow network?

2009-01-12 Thread MRAB
Laszlo Nagy wrote: [snip] Here are some more test results: - original example with setblocking(0) and TCP_NODELAY: 130 messages / sec - same example without TCP_NODELAY: 130 messages/sec (I don't understand why?) - same example without setblocking(0): 130 messages/sec (I guess because I'm u

Re: python3.0 MySQLdb

2009-01-12 Thread gert
On Jan 12, 8:25 pm, "Daniel Fetchinson" wrote: > > I need something to connect to a database, preferably mysql, that > > works in python3.0 please. > > And your question is? MySQLdb or something else for python3.0 ? -- http://mail.python.org/mailman/listinfo/python-list

Re: python3.0 MySQLdb

2009-01-12 Thread skip
>> > I need something to connect to a database, preferably mysql, that >> > works in python3.0 please. >> >> And your question is? gert> MySQLdb or something else for python3.0 ? Given that Python 3.0 is so new and so few packages have been ported to it yet, it might be help

Re: BadZipfile "file is not a zip file"

2009-01-12 Thread webcomm
On Jan 12, 11:53 am, "Chris Mellon" wrote: > On Sat, Jan 10, 2009 at 1:32 PM,webcomm wrote: > > On Jan 9, 7:33 pm, John Machin wrote: > >> It is not impossible for a file with dummy data to have been > >> handcrafted or otherwise produced by a process different to that used > >> for a real-data f

Re: Slow network?

2009-01-12 Thread Laszlo Nagy
Waiting for a response after each send will take longer than doing the sends and then the responses. Have you tried pinging the destination to see how long the round trip takes? Has your friend? My test application listens on 127.0.0.1. gand...@gandalf-desktop:~/Python/Lib/orb/examples/01_

Re: Problem with -3 switch

2009-01-12 Thread Carl Banks
On Jan 12, 5:26 am, John Machin wrote: > On Jan 12, 7:29 pm, Carl Banks wrote: > > > > > On Jan 12, 12:32 am, John Machin wrote: > > > > On Jan 12, 12:23 pm, Carl Banks wrote: > > > > > On Jan 9, 6:11 pm, John Machin wrote: > > > > > > On Jan 10, 6:58 am, Carl Banks wrote: > > > > > > I expec

Re: efficient interval containment lookup

2009-01-12 Thread Tim Chase
suppose I have two lists of intervals, one significantly larger than the other. For example listA = [(10, 30), (5, 25), (100, 200), ...] might contain thousands of elements while listB (of the same form) might contain hundreds of thousands or millions of elements. I want to count how many interval

Re: efficient interval containment lookup

2009-01-12 Thread Scott David Daniels
Are these ranges constrained in any way? Does preprocessing count in the efficiency cost? Is the long list or the short list fixed while the other varies? With no constraints the problem is harder. > But perhaps there's a way to index this that makes things more > efficient? I.e. a smart way of

Re: efficient interval containment lookup

2009-01-12 Thread Robert Kern
[Apologies for piggybacking, but I think GMane had a hiccup today and missed the original post] [Somebody wrote]: suppose I have two lists of intervals, one significantly larger than the other. For example listA = [(10, 30), (5, 25), (100, 200), ...] might contain thousands of elements while li

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-12 Thread Bruno Desthuilliers
Paul Rubin a écrit : Carl Banks writes: The criticism is very valid. Some languages do support immutable variables (e.g. "final" declarations in Java, "const" in C++, or universal immutability in pure functional languages) and they do so precisely for the purpose of taming the chaos of uncontr

Re: Unbinding Tkinter default bindings for Listbox

2009-01-12 Thread Roger
I'm sorry for harassing the list but any suggestions would be greatly appreciated. =) -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >