Elisa Media Center 0.5.23 Release

2009-01-12 Thread Olivier Tilloy
Dear Python users, After a quite silent month (during which we did not remain completely inactive), the Elisa team is happy to announce the release of Elisa Media Center 0.5.23, code-named Play The Game. Elisa is a cross-platform and open-source Media Center written in Python. It uses GStreamer

Re: Problem with -3 switch

2009-01-12 Thread Steve Holden
Carl Banks wrote: On Jan 9, 6:11 pm, John Machin sjmac...@lexicon.net wrote: On Jan 10, 6:58 am, Carl Banks pavlovevide...@gmail.com 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

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 ron.ba...@lsi.com 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

Re: Object help

2009-01-12 Thread Steve Holden
James Mills wrote: On Mon, Jan 12, 2009 at 9:49 AM, killsto kilian...@gmail.com 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

Re: Problem with -3 switch

2009-01-12 Thread Carl Banks
On Jan 12, 12:32 am, John Machin sjmac...@lexicon.net wrote: On Jan 12, 12:23 pm, Carl Banks pavlovevide...@gmail.com wrote: On Jan 9, 6:11 pm, John Machin sjmac...@lexicon.net wrote: On Jan 10, 6:58 am, Carl Banks pavlovevide...@gmail.com wrote: On Jan 9, 12:36 pm, J. Cliff Dyer

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 notval...@sbcglobal.net 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

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 notval...@sbcglobal.net wrote: John Machin wrote: On Jan 12, 2:00 pm, W. eWatson notval...@sbcglobal.net 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

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

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 --

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

2009-01-12 Thread Antoon Pardon
On 2008-12-31, TP tribulati...@paralleles.invalid 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

Re: Problem with -3 switch

2009-01-12 Thread John Machin
On Jan 12, 7:29 pm, Carl Banks pavlovevide...@gmail.com wrote: On Jan 12, 12:32 am, John Machin sjmac...@lexicon.net wrote: On Jan 12, 12:23 pm, Carl Banks pavlovevide...@gmail.com wrote: On Jan 9, 6:11 pm, John Machin sjmac...@lexicon.net wrote: On Jan 10, 6:58 am, Carl Banks

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', 'B1-Motion', _) You want b.tk.call('bind', 'Listbox', 'B1-Motion', ) of course. James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com --

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

Re: hlep: a text search and rename question

2009-01-12 Thread sensen
On Jan 12, 8:17 pm, James Stroud jstr...@mbi.ucla.edu 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

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 ufoo [except maybe unlikely suspects like open()'s mode arg]: * how many

Re: Implementing file reading in C/Python

2009-01-12 Thread Sion Arrowsmith
Grant Edwards inva...@invalid wrote: On 2009-01-09, Sion Arrowsmith si...@chiark.greenend.org.uk wrote: Grant Edwards inva...@invalid 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

Re: Problem with -3 switch

2009-01-12 Thread John Machin
On Jan 12, 11:05 pm, Christian Heimes li...@cheimes.de 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 ufoo

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?

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 the

Re: Implementing file reading in C/Python

2009-01-12 Thread sturlamolden
On Jan 9, 6:41 pm, Sion Arrowsmith si...@chiark.greenend.org.uk 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

Re: Implementing file reading in C/Python

2009-01-12 Thread Sion Arrowsmith
In case the cancel didn't get through: Sion Arrowsmith si...@chiark.greenend.org.uk wrote: Grant Edwards inva...@invalid 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 --

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 text data *

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 condition: break The danger with such a code is that it might go to an infinite loop - if the condition never occurs. Is there a way - a python trick - to have a check such that if the loop goes

Re: Implementing file reading in C/Python

2009-01-12 Thread sturlamolden
On Jan 12, 1:52 pm, Sion Arrowsmith si...@chiark.greenend.org.uk 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

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

2009-01-12 Thread bieffe62
On 12 Gen, 00:02, Paul Rubin http://phr...@nospam.invalid wrote: Carl Banks pavlovevide...@gmail.com 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

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 should

Re: Implementing file reading in C/Python

2009-01-12 Thread Hrvoje Niksic
sturlamolden sturlamol...@yahoo.no writes: On Jan 9, 6:41 pm, Sion Arrowsmith si...@chiark.greenend.org.uk 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

Re: Python tricks

2009-01-12 Thread Ben Finney
RajNewbie raj.indian...@gmail.com 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’

Re: Problem with -3 switch

2009-01-12 Thread John Machin
On Jan 13, 12:06 am, Christian Heimes li...@cheimes.de 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

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

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 sjmac...@lexicon.net wrote: On Jan 11, 2:45 am, sim.sim maksim.kasi...@gmail.com 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

Re: Python tricks

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

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

2009-01-12 Thread John Machin
On Jan 13, 12:45 am, sim.sim maksim.kasi...@gmail.com wrote: On 10 ÑÎ×, 23:40, John Machin sjmac...@lexicon.net wrote: On Jan 11, 2:45šam, sim.sim maksim.kasi...@gmail.com wrote: Hi all! I had touch with some different python behavior: I was tried to write into a file a string

Re: Python tricks

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

Re: Python tricks

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

Re: mod_python: delay in files changing after alteration

2009-01-12 Thread psaff...@googlemail.com
On 6 Jan, 23:31, Graham Dumpleton graham.dumple...@gmail.com 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

Re: Python tricks

2009-01-12 Thread John Machin
On Jan 13, 12:51 am, Tim Chase python.l...@tim.thechases.com 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

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

2009-01-12 Thread Roy Smith
In article 7x1vv83afq@ruckus.brouhaha.com, Paul Rubin http://phr...@nospam.invalid 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

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 --

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 =

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 installed

Re: hlep: a text search and rename question

2009-01-12 Thread sensen
On Jan 12, 10:41 pm, sensen zhangfang@gmail.com 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

Re: subprocess.Popen stalls

2009-01-12 Thread Jean-Paul Calderone
On Mon, 12 Jan 2009 06:37:35 -0800 (PST), psaff...@googlemail.com 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

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

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 if

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 notval...@sbcglobal.net wrote: John Machin wrote: On Jan 12, 2:00 pm, W. eWatson notval...@sbcglobal.net 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

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

2009-01-12 Thread bieffe62
On 12 Gen, 14:45, Paul Rubin http://phr...@nospam.invalid 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__ is for.

Re: Implementing file reading in C/Python

2009-01-12 Thread Grant Edwards
On 2009-01-12, Sion Arrowsmith si...@chiark.greenend.org.uk wrote: Grant Edwards inva...@invalid wrote: On 2009-01-09, Sion Arrowsmith si...@chiark.greenend.org.uk wrote: Grant Edwards inva...@invalid wrote: If I were you, I'd try mmap()ing the file instead of reading it into string objects

Re: subprocess.Popen stalls

2009-01-12 Thread psaff...@googlemail.com
On 12 Jan, 15:33, mk mrk...@gmail.com 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 si...@chiark.greenend.org.uk wrote: In case the cancel didn't get through: Sion Arrowsmith si...@chiark.greenend.org.uk wrote: Grant Edwards inva...@invalid wrote: 2GB should easily fit within the process's virtual memory space. Assuming you're in a 64bit world.

Re: subprocess.Popen stalls

2009-01-12 Thread mk
psaff...@googlemail.com wrote: On 12 Jan, 15:33, mk mrk...@gmail.com 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

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 =

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 bj_...@gmx.net 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

Re: BadZipfile file is not a zip file

2009-01-12 Thread Chris Mellon
On Sat, Jan 10, 2009 at 1:32 PM, webcomm rya...@gmail.com wrote: On Jan 9, 7:33 pm, John Machin sjmac...@lexicon.net 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

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 http://phr...@nospam.invalid 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__

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

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

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

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

Re: Python tricks

2009-01-12 Thread Scott David Daniels
RajNewbie wrote: On Jan 12, 6:51 pm, Tim Chase python.l...@tim.thechases.com 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 condition: break if inifinte_loop(): raise

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 my

Re: Egg deinstallation

2009-01-12 Thread Ned Deily
In article 6t139nf8ip4...@mid.uni-berlin.de, Diez B. Roggisch de...@nospam.web.de 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

Re: Unbinding Tkinter default bindings for Listbox

2009-01-12 Thread Roger
On Jan 12, 6:31 am, James Stroud jstr...@mbi.ucla.edu wrote: James Stroud wrote: py b.tk.call('bind', 'Listbox', 'B1-Motion', _) You want b.tk.call('bind', 'Listbox', 'B1-Motion', ) of course. James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles,

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_[ a

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

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 j...@unc.edu 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 gand...@shopzeus.com 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

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

Re: Slow network?

2009-01-12 Thread MRAB
Chris Mellon wrote: On Mon, Jan 12, 2009 at 1:13 PM, Laszlo Nagy gand...@shopzeus.com 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,

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: 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

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

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

Re: python3.0 MySQLdb

2009-01-12 Thread gert
On Jan 12, 8:25 pm, Daniel Fetchinson fetchin...@googlemail.com 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 helpful if you

Re: BadZipfile file is not a zip file

2009-01-12 Thread webcomm
On Jan 12, 11:53 am, Chris Mellon arka...@gmail.com wrote: On Sat, Jan 10, 2009 at 1:32 PM,webcommrya...@gmail.com wrote: On Jan 9, 7:33 pm, John Machin sjmac...@lexicon.net wrote: It is not impossible for a file with dummy data to have been handcrafted or otherwise produced by a process

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.

Re: Problem with -3 switch

2009-01-12 Thread Carl Banks
On Jan 12, 5:26 am, John Machin sjmac...@lexicon.net wrote: On Jan 12, 7:29 pm, Carl Banks pavlovevide...@gmail.com wrote: On Jan 12, 12:32 am, John Machin sjmac...@lexicon.net wrote: On Jan 12, 12:23 pm, Carl Banks pavlovevide...@gmail.com wrote: On Jan 9, 6:11 pm, John Machin

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

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

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

2009-01-12 Thread Bruno Desthuilliers
Paul Rubin a écrit : Carl Banks pavlovevide...@gmail.com 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

  1   2   3   >