Re: list index()

2007-08-30 Thread Marc 'BlackJack' Rintsch
On Wed, 29 Aug 2007 23:44:33 -0700, zzbbaadd wrote: > What's with the index() function of lists throwing an exception on not > found? Let's hope this is rectified in Python 3. If nothing else, add > a function that doesn't throw an exception. There are a million > situations where you can have an

Re: list index()

2007-08-30 Thread Ben Finney
[EMAIL PROTECTED] writes: > What's with the index() function of lists throwing an exception on not > found? It's letting you know that the item isn't in the list. There's no sensible return value from an "index" function in that condition. > Let's hope this is rectified in Python 3. If nothing e

Re: We need PIGs :)

2007-08-30 Thread Marc 'BlackJack' Rintsch
On Thu, 30 Aug 2007 07:10:47 +0200, Martin Marcher wrote: > Does that sound like a good idea or would that be over formalization? Sounds like over engineering/formalization to me. You are aware of the Python Enhancement Proposals (PEPs)? Is something like the `Python Database API Specification

Re: We need PIGs :)

2007-08-30 Thread Carl Banks
On Thu, 30 Aug 2007 07:10:47 +0200, Martin Marcher wrote: > My idea was to define "Python Implementation Guidelines" (PIGs) that > specify a problem formalize it enough so that implementations are > interchangeable (in this example create a module that has an > "authenticate(username, password)" me

Re: replacing xml elements with other elements using lxml

2007-08-30 Thread Stefan Behnel
Ultrus wrote: > Ah! I figured it out. I forgot that the tree is treated like a list. > The solution was to replace the element with the first > child, then use Python's insert(i,x) function to insert elements after > the first one. You could also use slicing, something like: parent[2:3] = c

Re: Python molecular viewer

2007-08-30 Thread Paul McGuire
On Aug 29, 8:31 am, Andy Cheesman <[EMAIL PROTECTED]> wrote: > Dear People, > > I was wondering if people could recommend a simple molecular viewing > package written in python. I'm working in Theoretical chemistry and I'm > not after an all-singing dancing molecular rendering package(pymol does >

Re: list index()

2007-08-30 Thread Marc 'BlackJack' Rintsch
On Thu, 30 Aug 2007 17:09:36 +1000, Ben Finney wrote: > [EMAIL PROTECTED] writes: > >> What's with the index() function of lists throwing an exception on not >> found? > > It's letting you know that the item isn't in the list. There's no > sensible return value from an "index" function in that c

Re: list index()

2007-08-30 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > What's with the index() function of lists throwing an exception on not > found? Let's hope this is rectified in Python 3. If nothing else, add > a function that doesn't throw an exception. There are a million > situations where you can have an item not be in a list and

Re: Embedding the python interpreter

2007-08-30 Thread Tom Gur
On Aug 28, 4:03 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-08-28, Tom Gur <[EMAIL PROTECTED]> wrote: > > > Hey, > > > Do you know an easy way to embed the python interpreter in a python > > program (so a non-technical user, which has no idea how to install the > > python interpreter wou

Re: Creating a multi-tier client/server application

2007-08-30 Thread Paul Rubin
Jeff <[EMAIL PROTECTED]> writes: > I was really hoping to avoid an entirely web-based app, for a few > reasons, not the least of which is that I've been working almost > entirely on web apps for the past few years, and I am getting mighty > sick of it. If you've done any gui programming, you'll kn

Re: list index()

2007-08-30 Thread Ben Finney
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes: > On Thu, 30 Aug 2007 17:09:36 +1000, Ben Finney wrote: > > It's letting you know that the item isn't in the list. There's no > > sensible return value from an "index" function in that condition. > > What about -1? C programmers do this all th

Re: list index()

2007-08-30 Thread Ben Finney
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > What's with using your brain instead of whining ? Now now, no need for snappiness. If you don't feel a constructive response is merited, please ignore. -- \ "A lot of people are afraid of heights. Not me, I'm afraid of | `\

Re: list index()

2007-08-30 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> writes: > def get_an_index_even_if_not_found(the_list, the_item): Bah. Should be "…(the_list, the_value):". -- \"Don't worry about people stealing your ideas. If your ideas | `\are any good, you'll have to ram them down people's throats." | _o_

Python doesn't see the directories I create

2007-08-30 Thread mr_gadget
When I create a subfolder, python is not seeing it. Can someone please explain this behaviour ? I just started with python, read the tutorial over the weekend and am writing my very first script. So I may not be seeing something. Both os.path and glob.glob seem not to see a folder I created. Ot

Re: list index()

2007-08-30 Thread Bruno Desthuilliers
Ben Finney a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > >> What's with using your brain instead of whining ? > > Now now, no need for snappiness. If you don't feel a constructive > response is merited, please ignore. Yes, you're right. Sorry. -- http://mail.python.org/mailman/

Re: Python doesn't see the directories I create

2007-08-30 Thread Bruno Desthuilliers
mr_gadget a écrit : > When I create a subfolder, python is not seeing it. Can someone please > explain this behaviour ? I just started with python, read the tutorial over > the weekend and am writing my very first script. So I may not be seeing > something. Both os.path and glob.glob seem not to

Re: Python doesn't see the directories I create

2007-08-30 Thread Diez B. Roggisch
mr_gadget schrieb: > When I create a subfolder, python is not seeing it. Can someone please > explain this behaviour ? I just started with python, read the tutorial over > the weekend and am writing my very first script. So I may not be seeing > something. Both os.path and glob.glob seem not to

Re: Python doesn't see the directories I create

2007-08-30 Thread Marc 'BlackJack' Rintsch
On Thu, 30 Aug 2007 04:30:50 -0400, mr_gadget wrote: > C:\>python -c "import os; print os.path.exists('C:\enhancement\rawfiles')" > > False > > C:\>python -c "import os; print os.path.exists('C:\\enhancement\\rawfiles')" > > True The backward slash has a special meaning in string literals. It

Re: Python doesn't see the directories I create

2007-08-30 Thread lupino
Ciao mr_gadget, > When I create a subfolder, python is not seeing it. Can someone please > explain this behaviour ? I just started with python, read the tutorial over > the weekend and am writing my very first script. So I may not be seeing > something. Both os.path and glob.glob seem not to se

gc.garbage

2007-08-30 Thread 7stud
gc.garbage returns an empty list even though the command: gc.set_debug(gc.DEBUG_LEAK) produces the following output: gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable I expected all those objects to be in the list returned by gc.garbage. Here's the code: import gc

Re: gc.garbage

2007-08-30 Thread Martin v. Löwis
> gc.set_debug(gc.DEBUG_LEAK) > print gc.garbage > > --output:-- > [] > gc: uncollectable > gc: uncollectable > gc: uncollectable > gc: uncollectable gc.garbage is filled only after these messages are printed, not before. You need to add an explicit call to gc.collect() if you want to see wha

Re: IDE for Python

2007-08-30 Thread Ali
On Aug 21, 11:00 am, Joel Andres Granados <[EMAIL PROTECTED]> wrote: > Hello list: > > I have tried various times to use an IDE for python put have always been > disapointed. > I haven't revisited the idea in about a year and was wondering what the > python people > use. > I have also found http://

problem with SQLObject + mysql

2007-08-30 Thread Guillermo Heizenreder
Hi list I'm new whit SQLObjet. I'm study the tutorial:Connecting databases to Python with SQLObjet[1] My problem is: >>>from sqlobject.mysql import builder >>>con=builder()(user='dbuser',passwd='dbpassword',host='localhost',db='garbanzo') Traceback (most recent call last): File "", line 1, in

Re: Python doesn't see the directories I create

2007-08-30 Thread Steve Holden
Bruno Desthuilliers wrote: > mr_gadget a écrit : >> When I create a subfolder, python is not seeing it. Can someone please >> explain this behaviour ? I just started with python, read the tutorial over >> the weekend and am writing my very first script. So I may not be seeing >> something. Both

Re: Unzip: Memory Error

2007-08-30 Thread mcl
On 29 Aug, 21:18, David Bolen <[EMAIL PROTECTED]> wrote: > mcl <[EMAIL PROTECTED]> writes: > > I am trying to unzip an 18mb zip containing just a single 200mb file > > and I get a Memory Error. When I run the code on a smaller file 1mb > > zip, 11mb file, it works fine. > (...) > > def unzip_file_

Re: Python doesn't see the directories I create

2007-08-30 Thread Bruno Desthuilliers
Steve Holden a écrit : > Bruno Desthuilliers wrote: (snip) >> You can avoid all escaping by using raw strings: >> >> mypath = r"C:\enhancement\rawfiles\" >> > Please note that the above is a well-known syntax error. A string > literal cannot end with a single backslash, as it escapes the closing

Re: python + gcov

2007-08-30 Thread labrach
Some precisions : I've forced the configuration options with the followings flags in the Makefile.pre : OPT='-Wall -fprofile-arcs -ftest-coverage -pg' BASECFLAGS='-Wall -fprofile-arcs -ftest-coverage -pg' LDFLAGS='-Wall -fprofile-arcs -ftest-coverage -pg' XLINKER='-Wall -fprofile-arcs -ftes

Re: Python doesn't see the directories I create

2007-08-30 Thread Steve Holden
Bruno Desthuilliers wrote: > Steve Holden a écrit : >> Bruno Desthuilliers wrote: [...] >> That does indeed work in most situations, but ideally (i.e. for maximum >> code portability) paths should be constructed using os.path.join(), or >> collected from the environment somehow. > > Indeed. But

SAXParseException: not well-formed (invalid token)

2007-08-30 Thread Pablo Rey
Dear Colleagues, I am getting the following error with a XML page: > File "/home/prey/RAL-CESGA/bin/voms2users/voms2users.py", line 69, in > getItems > d = minidom.parseString(xml.read()) > File "/usr/lib/python2.2/site-packages/_xmlplus/dom/minidom.py", line 967, > in p

Re: list index()

2007-08-30 Thread Carsten Haese
On Wed, 2007-08-29 at 23:44 -0700, [EMAIL PROTECTED] wrote: > What's with the index() function of lists throwing an exception on not > found? Let's hope this is rectified in Python 3. You're assuming that this behavior is a mistake. It's not, and consequently, it won't be "rectified". > If nothi

logging.config.fileConfig disables existing loggers

2007-08-30 Thread Robert
Hi I have been grappling today with some unexpected behaviour from logging.config.fileConfig. I am using the following config file: [loggers] keys=root [handlers] keys=console [formatters] keys=form01 [logger_root] level=DEBUG handlers=console [handler_console] class=StreamHandler level=NOTSE

Important Research Project

2007-08-30 Thread E.D.G.
Important Research Project (Related to computer programming) Posted by E.D.G. on August 30, 2007 [EMAIL PROTECTED] This report is being posted to a number of Internet Newsgroups to see if there are any experienced computer programmers who would like to provide some assistance with an effort

Re: SAXParseException: not well-formed (invalid token)

2007-08-30 Thread Marc 'BlackJack' Rintsch
On Thu, 30 Aug 2007 13:46:47 +0200, Pablo Rey wrote: > The page is > https://lcg-voms.cern.ch:8443/voms/cms/services/VOMSCompatibility?method=getGridmapUsers > > and the line with the invalid character is (the invalid character is the > final é of Université): The URL doesn't work for m

Re: SAXParseException: not well-formed (invalid token)

2007-08-30 Thread Stefan Behnel
Pablo Rey wrote: > I am getting the following error with a XML page: > >> File "/home/prey/RAL-CESGA/bin/voms2users/voms2users.py", line 69, >> in getItems >> d = minidom.parseString(xml.read()) >> File "/usr/lib/python2.2/site-packages/_xmlplus/dom/minidom.py", >> line 967, in parseSt

Re: Python doesn't see the directories I create

2007-08-30 Thread Marc 'BlackJack' Rintsch
On Thu, 30 Aug 2007 07:28:52 -0400, Steve Holden wrote: > Bruno Desthuilliers wrote: >> Steve Holden a écrit : >> Indeed. But I doubt a path starting with 'C:' will work fine on a >> unix-like environment anyway !-) > > Just to be contrarian: > > [EMAIL PROTECTED] ~/Projects/python.org/build >

Re: problem with SQLObject + mysql

2007-08-30 Thread Guillermo Heizenreder
El jue, 30-08-2007 a las 07:33 -0300, Guillermo Heizenreder escribió: > Hi list I'm new whit SQLObjet. > I'm study the tutorial:Connecting databases to Python with SQLObjet[1] > > My problem is: > >>>from sqlobject.mysql import builder > >>>con=builder()(user='dbuser',passwd='dbpassword',host='lo

Re: Creating a multi-tier client/server application

2007-08-30 Thread vanrpeterson
We totally agree with your software engineering goals. Relying on wxPython and minimizing web reliance brings sanity to the enterprise. We too love PostgreSQL and avoid XML whether cleaned by SOAP at all costs. We have found the object-relationship managers to be bloated and unruly. What are yo

Re: Creating a multi-tier client/server application

2007-08-30 Thread vanrpeterson
We totally agree with your software engineering goals. Relying on wxPython and minimizing web reliance brings sanity to the enterprise. We too love PostgreSQL and avoid XML whether cleaned by SOAP at all costs. We have found the object-relationship managers to be bloated and unruly. What are yo

Re: SAXParseException: not well-formed (invalid token)

2007-08-30 Thread Pablo Rey
Hi Stefan, The xml has specified an encoding (). About the possibility that you mention to recoding the input, could you let me know how to do it?. I am sorry I am starting with Python and I don't know how to do it. Thanks by your help. Pablo

Re: Asking all python programmers.

2007-08-30 Thread Hyuga
On Aug 29, 11:09 am, "sjpiii" <[EMAIL PROTECTED]> wrote: > You mean use correct spelling and grammar? But what about all the time > we've spent creating cutesy little non-words like "l8er?" > > Actually, I'm less tolerant of those than of normal spelling and grammar > errors because of the number

Re: Python doesn't see the directories I create

2007-08-30 Thread Neil Cerutti
On 2007-08-30, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > mr_gadget a écrit : >> When I create a subfolder, python is not seeing it. Can someone please >> explain this behaviour ? I just started with python, read the tutorial over >> the weekend and am writing my very first script. So I may

Re: SAXParseException: not well-formed (invalid token)

2007-08-30 Thread Marc 'BlackJack' Rintsch
On Thu, 30 Aug 2007 15:31:58 +0200, Pablo Rey wrote: > On 30/08/2007 14:35, Marc 'BlackJack' Rintsch wrote: > >> Maybe you can download that XML file and use `xmllint` to check if it >> is well formed XML!? > > This is the output of the xmllint command: > > [EMAIL PROTECTED] voms2users]$ x

Re: SAXParseException: not well-formed (invalid token)

2007-08-30 Thread Carsten Haese
On Thu, 2007-08-30 at 15:20 +0200, Pablo Rey wrote: > Hi Stefan, > > The xml has specified an encoding ( ?>). It's possible that the encoding specification is incorrect: >>> u = u"\N{LATIN SMALL LETTER E WITH ACUTE}" >>> print repr(u.encode("latin-1")) '\xe9' >>> print repr(u.encode(

Re: list index()

2007-08-30 Thread Marshall T. Vandegrift
[EMAIL PROTECTED] writes: > What's with the index() function of lists throwing an exception on not > found? Let's hope this is rectified in Python 3. If nothing else, add > a function that doesn't throw an exception. There are a million > situations where you can have an item not be in a list and

Re: Sorting a list of Unicode strings?

2007-08-30 Thread koen . vanleemput
Wikipedia in Suomi lists it at the bottom ;-) http://sv.wikipedia.org/wiki/Lista_%C3%B6ver_l%C3%A4nder#.C3.85 Cheers ~K -- http://mail.python.org/mailman/listinfo/python-list

Re: Important Research Project

2007-08-30 Thread Paul McGuire
On Aug 30, 8:12 am, "E.D.G." <[EMAIL PROTECTED]> wrote: > Important Research Project (Related to computer programming) > > Posted by E.D.G. on August 30, 2007 [EMAIL PROTECTED] > > This report is being posted to a number of Internet Newsgroups Always the hallmark of a considerate poster. > t

Re: SAXParseException: not well-formed (invalid token)

2007-08-30 Thread Carsten Haese
On Thu, 2007-08-30 at 15:20 +0200, Pablo Rey wrote: > About the possibility that you mention to recoding the input, could you > let me know how to do it?. I am sorry I am starting with Python and I > don't know how to do it. While I answered this question in my previous reply, I wanted to

strings (dollar.cents) into floats

2007-08-30 Thread luca bertini
Hi, i have strings which look like money values (ie 34.45) is there a way to convert them into float variables? everytime i try I get this error: "numb = float(my_line) ValueError: empty string for float()" " here's the code import sys import re for line in sys.stdin.readlines():

Re: strings (dollar.cents) into floats

2007-08-30 Thread Marshall T. Vandegrift
luca bertini <[EMAIL PROTECTED]> writes: > i have strings which look like money values (ie 34.45) > is there a way to convert them into float variables? > everytime i try I get this error: "numb = float(my_line) ValueError: > empty string for float()" > " You actually have problems here -- the

Re: strings (dollar.cents) into floats

2007-08-30 Thread Gary Herron
luca bertini wrote: > Hi, > > i have strings which look like money values (ie 34.45) > is there a way to convert them into float variables? > everytime i try I get this error: "numb = float(my_line) ValueError: > empty string for float()" > " > here's the code > > > > import sys > im

Re: list index()

2007-08-30 Thread Marc 'BlackJack' Rintsch
On Thu, 30 Aug 2007 09:53:53 -0400, Marshall T. Vandegrift wrote: > The Python string types have both the method `index()` which throws an > exception and the method `find()` which implements the same behavior but > returns -1 for not-found substrings. I would naively have assumed the > `list` ty

SOCKS5 + python = pain in you-know-where ?

2007-08-30 Thread Valery
Hi all just googled both the web and groups. Who could believe in that: nothing simple, helpful and working concerning SOCKS5 support in python. Anyone got success here? Regards, Valery. -- http://mail.python.org/mailman/listinfo/python-list

Re: We need PIGs :)

2007-08-30 Thread Martin Marcher
Hello, On 30 Aug 2007 07:14:25 GMT, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Thu, 30 Aug 2007 07:10:47 +0200, Martin Marcher wrote: > > > Does that sound like a good idea or would that be over formalization? > > Sounds like over engineering/formalization to me. > You are aware of t

Re: strings (dollar.cents) into floats

2007-08-30 Thread J. Cliff Dyer
Gary Herron wrote: luca bertini wrote: Hi, i have strings which look like money values (ie 34.45) is there a way to convert them into float variables? everytime i try I get this error: "numb = float(my_line) ValueError: empty string for float()" " here's the code import sys

Please assist- Python Consultant needed for 3-6 month project

2007-08-30 Thread Kelley McNeillie
I am contacting you from a company called Software Specialists, an IT Placement Firm based in Pittsburgh, PA. We are prepared to make a donation to your organization if you could please help us out with a referral. We are looking for a python developer with web-based application experience.

Re: list index()

2007-08-30 Thread zzbbaadd
On Aug 30, 12:09 am, Ben Finney <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > What's with the index() function of lists throwing an exception on not > > found? > > It's letting you know that the item isn't in the list. There's no > sensible return value from an "index" function in that

Python threading

2007-08-30 Thread Robert . R . Emmel
Hello, I am using the threading module and the Queue module in python to to send out shipment tracking URL requests. Is there a way to timeout a thread within a Queue? I think the way I have it now the thread will wait until something is returned and will basically wait forever for that somethin

Re: Python doesn't see the directories I create

2007-08-30 Thread Steve Holden
Neil Cerutti wrote: > On 2007-08-30, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >> mr_gadget a écrit : >>> When I create a subfolder, python is not seeing it. Can someone please >>> explain this behaviour ? I just started with python, read the tutorial over >>> the weekend and am writing my v

Re: Python threading

2007-08-30 Thread Chris Mellon
On 8/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > I am using the threading module and the Queue module in python to to > send out shipment tracking URL requests. > > Is there a way to timeout a thread within a Queue? > > I think the way I have it now the thread will wait until s

Re: Please assist- Python Consultant needed for 3-6 month project

2007-08-30 Thread Steve Holden
Kelley McNeillie wrote: > I am contacting you from a company called Software Specialists, an IT > Placement Firm based in Pittsburgh, PA. We are prepared to make a donation > to your organization if you could please help us out with a referral. We are > looking for a python developer with web

Re: How to use os.putenv() ?

2007-08-30 Thread T
On Aug 29, 9:50 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Aug 30, 11:21 am, [EMAIL PROTECTED] wrote: > > > > > >>> import os > > > >>> os.environ['PATH'] > > > 'C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;%C:\\WINNT%\ > > \system32;%C:\\WINNT%;%C:\\WINNT%\\System32\\Wbem' > >

Simple elementtree question

2007-08-30 Thread IamIan
This is in Python 2.3.5. I've had success with elementtree and other RSS feeds, but I can't get it to work with this format: http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:fr="http://ASPRSS.com/fr.html"; xmlns:pa="http://ASPRSS.com/pa.html"; xm

Re: Is LOAD_GLOBAL really that slow?

2007-08-30 Thread Rhamphoryncus
On Aug 29, 8:33 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Wed, 2007-08-29 at 19:23 -0600, Adam Olsen wrote: > > It seems a common opinion that global access is much slower than local > > variable access. However, my benchmarks show a relatively small > > difference: > > > ./python -m timei

Re: list index()

2007-08-30 Thread zzbbaadd
> > How could it not be an exception, in the plain English sense of the > word? Most certainly you're asking for the index because you want to do > something with the index. If the item is not found, you have no index, > so that's a special case that must be handled separately. There is no > logica

Re: Python doesn't see the directories I create

2007-08-30 Thread Steve Holden
Steve Holden wrote: [...] > The fact is that some strings are always going to cause trouble. > Unfortunately programming itself is a task that requires a little more > knowledge to be applied to the task. Just learn the rules and move on. As a quick follow-up, I had intended to comment on the us

Re: list index()

2007-08-30 Thread Robert Kern
[EMAIL PROTECTED] wrote: >> How could it not be an exception, in the plain English sense of the >> word? Most certainly you're asking for the index because you want to do >> something with the index. If the item is not found, you have no index, >> so that's a special case that must be handled separ

Re: list index()

2007-08-30 Thread zzbbaadd
On Aug 30, 12:42 am, Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : > > What's with using your brain instead of whining ? I knew there would be at least one religious zealot. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python doesn't see the directories I create

2007-08-30 Thread Neil Cerutti
On 2007-08-30, Steve Holden <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> To me, Python's collection of special-purpose string literal >> notations is one of its little warts. > > Well, it's a wart that's shared with many other languages - > including, interestingly enough, Microsoft's very o

Re: list index()

2007-08-30 Thread Steve Holden
[EMAIL PROTECTED] wrote: >> How could it not be an exception, in the plain English sense of the >> word? Most certainly you're asking for the index because you want to do >> something with the index. If the item is not found, you have no index, >> so that's a special case that must be handled separ

Re: Is LOAD_GLOBAL really that slow?

2007-08-30 Thread Chris Mellon
On 8/30/07, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Aug 29, 8:33 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > > On Wed, 2007-08-29 at 19:23 -0600, Adam Olsen wrote: > > There is no loop overhead here, and after subtracting the function call > > overhead, I get 31 nanoseconds per local looku

Re: list index()

2007-08-30 Thread Carsten Haese
On Thu, 2007-08-30 at 10:44 -0700, [EMAIL PROTECTED] wrote: > > > > How could it not be an exception, in the plain English sense of the > > word? Most certainly you're asking for the index because you want to do > > something with the index. If the item is not found, you have no index, > > so that'

Re: list index()

2007-08-30 Thread Carsten Haese
On Thu, 2007-08-30 at 10:56 -0700, [EMAIL PROTECTED] wrote: > On Aug 30, 12:42 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] a crit : > > > > > What's with using your brain instead of whining ? > > I knew there would be at least one religious zealot. While I agree that

Re: gc.garbage

2007-08-30 Thread 7stud
On Aug 30, 3:50 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > gc.set_debug(gc.DEBUG_LEAK) > > print gc.garbage > > > --output:-- > > [] > > gc: uncollectable > > gc: uncollectable > > gc: uncollectable > > gc: uncollectable > > gc.garbage is filled only after these messages > are printed

Re: list index()

2007-08-30 Thread Neil Cerutti
On 2007-08-30, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> How could it not be an exception, in the plain English sense >> of the word? Most certainly you're asking for the index >> because you want to do something with the index. If the item >> is not found, you have no index, so that's a spec

RE: list index()

2007-08-30 Thread Hamilton, William
> From: [EMAIL PROTECTED] > > > > How could it not be an exception, in the plain English sense of the > > word? Most certainly you're asking for the index because you want to do > > something with the index. If the item is not found, you have no index, > > so that's a special case that must be hand

Re: list index()

2007-08-30 Thread zzbbaadd
> While I agree that Bruno's response was perhaps needlessly snippy, your > original question was needlessly inflammatory, as if you somehow wanted > some "religious zealot" to act the way Bruno did. If we start labeling > people, this thread will earn you a label that rhymes with "roll". > That is

Re: list index()

2007-08-30 Thread zzbbaadd
Neil, Steve, Thanks for the responses on sets. I have not used them before and was not even aware Python had them. I will try them out. -- http://mail.python.org/mailman/listinfo/python-list

Re: gc.garbage

2007-08-30 Thread 7stud
On Aug 30, 3:50 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > gc.set_debug(gc.DEBUG_LEAK) > > print gc.garbage > > > --output:-- > > [] > > gc: uncollectable > > gc: uncollectable > > gc: uncollectable > > gc: uncollectable > > gc.garbage is filled only after these messages > are printed

Re: Creating a multi-tier client/server application

2007-08-30 Thread Jeff
Wow, there's a lot to respond to here. Thanks everyone for your help. I'll try to go in order. askel: Thanks, I've looked at this a little bit before, but now I've looked into it a little further. Seems pretty cool, but also fairly complex. Have you used it before? David: Sounds like a pretty

Re: list index()

2007-08-30 Thread Carsten Haese
On Thu, 2007-08-30 at 11:21 -0700, [EMAIL PROTECTED] wrote: > I wish they were not > getting rid of dict.has_key() in Python 3, which I prefer to IN. That wish will only come true if you maintain your own fork of Python 3. has_key() will go away, period. It has been made obsolete by "in", which is

Re: gc.garbage

2007-08-30 Thread Chris Mellon
On 8/30/07, 7stud <[EMAIL PROTECTED]> wrote: > On Aug 30, 3:50 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > gc.set_debug(gc.DEBUG_LEAK) > > > print gc.garbage > > > > > --output:-- > > > [] > > > gc: uncollectable > > > gc: uncollectable > > > gc: uncollectable > > > gc: uncollectable

create Powerpoint via com

2007-08-30 Thread Alan Isaac
Can someone point me to a simple example or better yet tutorial for creating a Powerpoint using Python. Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: list index()

2007-08-30 Thread Steve Holden
[EMAIL PROTECTED] wrote: >> While I agree that Bruno's response was perhaps needlessly snippy, your >> original question was needlessly inflammatory, as if you somehow wanted >> some "religious zealot" to act the way Bruno did. If we start labeling >> people, this thread will earn you a label that

Re: list index()

2007-08-30 Thread zzbbaadd
> That wish will only come true if you maintain your own fork of Python 3. > has_key() will go away, period. It has been made obsolete by "in", which > is faster and more concise. Is there really some reason "key" IN dict can be implemented faster than dict.has_key("key")??? -- http://mail.p

Re: Important Research Project

2007-08-30 Thread CBFalconer
"E.D.G." wrote: > > This report is being posted to a number of Internet Newsgroups to > see if there are any experienced computer programmers who would > like to provide some assistance with an effort to develop a Perl > language computer program. Where is Perl described in the C standard? This

Re: status of Programming by Contract (PEP 316)?

2007-08-30 Thread Chris Mellon
On 8/29/07, Russ <[EMAIL PROTECTED]> wrote: > > > But it's always a good idea to make your software "correct and as > > reliable as possible", isn't it? The problem is the external constraints > > on the project. As the old saying goes: "Cheap, fast, reliable: choose > > any two". > > If you are su

Re: list index()

2007-08-30 Thread Neil Cerutti
On 2007-08-30, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> That wish will only come true if you maintain your own fork of >> Python 3. has_key() will go away, period. It has been made >> obsolete by "in", which is faster and more concise. > > Is there really some reason "key" IN dict can be im

Re: list index()

2007-08-30 Thread Chris Mellon
On 8/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > That wish will only come true if you maintain your own fork of Python 3. > > has_key() will go away, period. It has been made obsolete by "in", which > > is faster and more concise. > > Is there really some reason "key" IN dict can be

pure python for sms

2007-08-30 Thread Gerardo Herzig
Hi dudes. Im looking for a python implementation for sending sms to a cell phone. I was try using some free pages, but i want to use a python. Do i need a cellphone conected to my machine? Or can i send sms to some cell via some python library? Waiting for advice. Thanks! Gerardo -- http://ma

Re: We need PIGs :)

2007-08-30 Thread [EMAIL PROTECTED]
On Aug 30, 12:10 am, "Martin Marcher" <[EMAIL PROTECTED]> wrote: [snip!] > > My idea was to define "Python Implementation Guidelines" (PIGs) that > specify a problem formalize it enough so that implementations are > interchangeable (in this example create a module that has an > "authenticate(usern

Re: Important Research Project

2007-08-30 Thread dave_w
On Aug 30, 2:54 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Aug 30, 8:12 am, "E.D.G." <[EMAIL PROTECTED]> wrote: > > > Important Research Project (Related to computer programming) > > > Posted by E.D.G. on August 30, 2007 [EMAIL PROTECTED] > > > This report is being posted to a number of

subclassing Python types

2007-08-30 Thread zzbbaadd
I have read that you can derive from the base classes such as str, list, dict. I guess this would look like: def MyString(str): def MyList(list): def MyDict(dict): How do you access the data that is contained in the super class? -- http://mail.python.org/mailman/listinfo/python-list

Re: Important Research Project

2007-08-30 Thread Tim Couper
Paul Excellent post .. brightens up the otherwise hum-drum life! Tim Dr Tim Couper CTO, SciVisum Ltd www.scivisum.com Paul McGuire wrote: > On Aug 30, 8:12 am, "E.D.G." <[EMAIL PROTECTED]> wrote: > >> Important Research Project (Related to computer programming) >> >> Posted by E.D.G. on

Re: list index()

2007-08-30 Thread Carsten Haese
On Thu, 2007-08-30 at 11:45 -0700, [EMAIL PROTECTED] wrote: > > That wish will only come true if you maintain your own fork of Python 3. > > has_key() will go away, period. It has been made obsolete by "in", which > > is faster and more concise. > > Is there really some reason "key" IN dict can b

Re: create Powerpoint via com

2007-08-30 Thread kyosohma
Alan, On Aug 30, 1:37 pm, Alan Isaac <[EMAIL PROTECTED]> wrote: > Can someone point me to a simple example > or better yet tutorial for creating > a Powerpoint using Python. > > Thanks, > Alan Isaac You should check our the following for information on using COM itself: http://www.oreilly.com/ca

Re: list index()

2007-08-30 Thread MRAB
On Aug 30, 7:00 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >> How could it not be an exception, in the plain English sense of the > >> word? Most certainly you're asking for the index because you want to do > >> something with the index. If the item is not found, you h

Re: list index()

2007-08-30 Thread MRAB
On Aug 30, 5:41 pm, [EMAIL PROTECTED] wrote: > On Aug 30, 12:09 am, Ben Finney <[EMAIL PROTECTED]> > wrote: > > > [EMAIL PROTECTED] writes: > > > What's with the index() function of lists throwing an exception on not > > > found? > > > It's letting you know that the item isn't in the list. There's

Re: subclassing Python types

2007-08-30 Thread Arnaud Delobelle
On Aug 30, 8:00 pm, [EMAIL PROTECTED] wrote: > I have read that you can derive from the base classes such as str, > list, dict. > > I guess this would look like: > > def MyString(str): > def MyList(list): > def MyDict(dict): You mean class MyString(str): ... > How do you access the data that is

Re: subclassing Python types

2007-08-30 Thread zzbbaadd
On Aug 30, 12:13 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Aug 30, 8:00 pm, [EMAIL PROTECTED] wrote: > > > I have read that you can derive from the base classes such as str, > > list, dict. > > > I guess this would look like: > > > def MyString(str): > > def MyList(list): > > def MyDict(

Re: subclassing Python types

2007-08-30 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote: > I have read that you can derive from the base classes such as str, > list, dict. > > I guess this would look like: > > def MyString(str): > def MyList(list): > def MyDict(dict): > > Well, replace 'def' with 'class' and you're right. > How do you access the data that

  1   2   3   >