Re: decorators when?

2008-05-27 Thread Dan Bishop
On May 27, 7:32 pm, Kam-Hung Soh <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > What version added decorators (using the > > @decorator syntax)? > > > (Is there a general way I could have found out the answer myself?) > > > Is there a somthing such that "from __future__ import something"

Re: Weird exception in my, um, exception class constructor

2008-05-27 Thread Arnaud Delobelle
"Joel Koltner" <[EMAIL PROTECTED]> writes: > "Paul Hankin" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > "Did you actually write self,args = args?" > > (looks at source code) > > [EMAIL PROTECTED] Why, yes, yes I did! Thanks for catching that... This is odd, because you shoul

Re: Hungarian Notation

2008-05-27 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Dan Bishop <[EMAIL PROTECTED]> wrote: > On May 27, 12:28 am, "inhahe" <[EMAIL PROTECTED]> wrote: > > Does anybody know of a list for canonical prefixes to use for hungarian > > notation in Python?  Not that I plan to name all my variables with hungarian > > notati

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-05-27 Thread Kam-Hung Soh
David Jackson wrote: i used the csv module and saved its contents to a list. ['Date', 'No.', 'Description', 'Debit', 'Credit'] ['3/17/2006', '5678', 'ELECTRONIC PAYMENT', '', '11.45'] ['3/04/2007', '5678', 'THE HOME DEPOT 263 SomeCity FL', '', '25.40'] the credit/debit fields are strings. what

Re: php vs python

2008-05-27 Thread Tim Roberts
Ivan Illarionov <[EMAIL PROTECTED]> wrote: >On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: >> In reply to Your message dated Monday, May 26, 2008, 04:47:00, >> As I've said before - good programmers can write good code in any language. >> >>> Yes, they can. But it may be harder to

Re: confused by HTMLParser class

2008-05-27 Thread XLiIV
On May 28, 3:20 am, globalrev <[EMAIL PROTECTED]> wrote: > tried all kinds of combos to get this to work. > > http://docs.python.org/lib/module-HTMLParser.html > > from HTMLParser import HTMLParser > > class MyHTMLParser(HTMLParser): > >     def handle_starttag(self, tag, attrs): >         print "E

Re: multi dimensional dictionary

2008-05-27 Thread Gary Herron
Alok Kumar wrote: Dear All, I am using dictionary for filling my xpath parsed data. I wanted to use in the following manner. mydict[index] ["key1"] ["key2"]#Can someone help me with right declaration. So that I can fill my XML xpath parsed data mydict[0] ["person"] ["setTime"] = "12:0

Re: Struct usages in Python

2008-05-27 Thread Casey McGinty
>self.event[] = Event() *# Seems this is not allowed ?? * > self.event = [Event()] - Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Struct usages in Python

2008-05-27 Thread Patrick Mullen
I don't know if this will go through (my posts seem to have become blocked lately), but I'll give it a shot anyhow. You seem to be under a misconception that a python list is similar to a list in say, Java or other languages that have a rigid idea of variables and types. In python, a list is a li

Keeping focus with sequential Tkinter windows?

2008-05-27 Thread William McBrine
So, basically what I'm doing is this: window1 = Tkinter.Tk() ... window1.destroy() ... window2 = Tkinter.Tk() This works well in Linux and Mac OS X (and the PyGtk equivalent works on all platforms), but in Windows XP, the second window comes up without focus. (I have to click on it to focus it.

multi dimensional dictionary

2008-05-27 Thread Alok Kumar
Dear All, I am using dictionary for filling my xpath parsed data. I wanted to use in the following manner. mydict[index] ["key1"] ["key2"]#Can someone help me with right declaration. So that I can fill my XML xpath parsed data mydict[0] ["person"] ["setTime"] = "12:09:30" mydict[0] ["perso

Struct usages in Python

2008-05-27 Thread Alok Kumar
Dear All, This might be very basic question for python, but I have been struggling with it. Your help will be highly appreciated. I have a class like below: class Event(): def __init__(self, cameraEventType="", zone=99, setDay="",setTime ="", clrTime=""): self.cameraEventType = camera

Re: maximum recursion depth?

2008-05-27 Thread John Nagle
alex23 wrote: On May 28, 9:26 am, globalrev <[EMAIL PROTECTED]> wrote: is there a definitie limit to the nbr of calls or is the memory that runs out? is that then the RAMmemory? is there a special amount of memory assigned for python or it just takes and takes until windows runs out of it? You

Re: Misuse of list comprehensions?

2008-05-27 Thread Ian Kelly
On Tue, May 27, 2008 at 8:08 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Tue, 27 May 2008 14:43:52 -0300, Ian Kelly <[EMAIL PROTECTED]> > escribió: > >> It sounds like the wasteful list creation is the biggest objection to >> using a list comprehension. I'm curious what people think of t

Re: Misuse of list comprehensions?

2008-05-27 Thread Ian Kelly
On Tue, May 27, 2008 at 7:09 PM, Delaney, Timothy (Tim) <[EMAIL PROTECTED]> wrote: > Ian Kelly wrote: > >> It sounds like the wasteful list creation is the biggest objection to >> using a list comprehension. I'm curious what people think of this >> alternative, which avoids populating the list by

Re: When was feature FOO added to Python? (was: decorators when?)

2008-05-27 Thread Terry Reedy
"Ben Finney" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | David C. Ullrich <[EMAIL PROTECTED]> writes: | | > What version added decorators (using the @decorator syntax)? | > | > (Is there a general way I could have found out the answer myself?) | | For standard library features,

Re: php vs python

2008-05-27 Thread Jerry Stuckle
Ivan Illarionov wrote: On Tue, 27 May 2008 22:27:40 -0400, Jerry Stuckle wrote: Ivan Illarionov wrote: On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote: Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message

Re: php vs python

2008-05-27 Thread Ivan Illarionov
On Tue, 27 May 2008 22:27:40 -0400, Jerry Stuckle wrote: > Ivan Illarionov wrote: >> On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote: >> >>> Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: > Greetings, Ivan Illarionov. > In reply to Your messa

Re: php vs python

2008-05-27 Thread Jerry Stuckle
Ivan Illarionov wrote: On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote: Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can

Re: confused by HTMLParser class

2008-05-27 Thread alex23
On May 28, 11:20 am, globalrev <[EMAIL PROTECTED]> wrote: > tried all kinds of combos to get this to work. Did you try searching this group? There were recent posts discussing basic usage of HTMLParser. Throwing random code together is the least likely way to actually get it to work. > x = MyHTM

Re: php vs python

2008-05-27 Thread Ivan Illarionov
On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote: > Ivan Illarionov wrote: >> On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: >> >>> Greetings, Ivan Illarionov. >>> In reply to Your message dated Monday, May 26, 2008, 04:47:00, >>> > As I've said before - good programmers can writ

Re: Misuse of list comprehensions?

2008-05-27 Thread Gabriel Genellina
En Tue, 27 May 2008 14:43:52 -0300, Ian Kelly <[EMAIL PROTECTED]> escribió: It sounds like the wasteful list creation is the biggest objection to using a list comprehension. I'm curious what people think of this alternative, which avoids populating the list by using a generator expression ins

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-05-27 Thread Gabriel Genellina
En Tue, 27 May 2008 13:00:05 -0300, David Jackson <[EMAIL PROTECTED]> escribió: i used the csv module and saved its contents to a list. ['Date', 'No.', 'Description', 'Debit', 'Credit'] ['3/17/2006', '5678', 'ELECTRONIC PAYMENT', '', '11.45'] ['3/04/2007', '5678', 'THE HOME DEPOT 263 SomeCity

Re: php vs python

2008-05-27 Thread Jerry Stuckle
Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for the

Re: php vs python

2008-05-27 Thread Ivan Illarionov
On Wed, 28 May 2008 01:32:24 +, Ivan Illarionov wrote: > On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: > >> Greetings, Ivan Illarionov. >> In reply to Your message dated Monday, May 26, 2008, 04:47:00, >> As I've said before - good programmers can write good code in any lang

Re: php vs python

2008-05-27 Thread Ivan Illarionov
On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: > Greetings, Ivan Illarionov. > In reply to Your message dated Monday, May 26, 2008, 04:47:00, > >>> As I've said before - good programmers can write good code in any >>> language. > >> Yes, they can. But it may be harder to do for them in one

confused by HTMLParser class

2008-05-27 Thread globalrev
tried all kinds of combos to get this to work. http://docs.python.org/lib/module-HTMLParser.html from HTMLParser import HTMLParser class MyHTMLParser(HTMLParser): def handle_starttag(self, tag, attrs): print "Encountered the beginning of a %s tag" % tag def handle_endtag(sel

RE: Misuse of list comprehensions?

2008-05-27 Thread Delaney, Timothy (Tim)
Ian Kelly wrote: > It sounds like the wasteful list creation is the biggest objection to > using a list comprehension. I'm curious what people think of this > alternative, which avoids populating the list by using a generator > expression instead (apart from the fact that this is still quadratic,

More than 500 Free webhostings

2008-05-27 Thread siva
Hi Friends In this world everyone is searching for free webhostings for their websites So only i found this website after some struggle it's a free webhosting directory www.webhostingsfree.com Having more than 500 free web hosting websites and free file hostings ,image hostings etc -- h

Re: php vs python

2008-05-27 Thread AnrDaemon
Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, >> As I've said before - good programmers can write good code in any >> language. > Yes, they can. But it may be harder to do for them in one language and > easier in another. It's obvious lie. If you hav

Re: definition of a highlevel language?

2008-05-27 Thread Henrique Dante de Almeida
On May 26, 3:34 pm, [EMAIL PROTECTED] wrote: > > what is the definition of a highlevel-language? > There's no formal definition of high level language. Thus, the following are true: 1) You can safely treat it as buzzword 2) You can't formally define a level hierarchy of languages 3) You can't

Re: decorators when?

2008-05-27 Thread Kam-Hung Soh
David C. Ullrich wrote: What version added decorators (using the @decorator syntax)? (Is there a general way I could have found out the answer myself?) Is there a somthing such that "from __future__ import something" will make decorators work in 2.5.2? David C. Ullrich See: http://www.pyth

Re: Extracting text from a Webpage using BeautifulSoup

2008-05-27 Thread Paul McGuire
On May 27, 5:01 am, [EMAIL PROTECTED] wrote: > Hi, > > I wish to extract all the words on a set of webpages and store them in > a large dictionary. I then wish to procuce a list with the most common > words for the language under consideration. So, my code below reads > the page - > > http://news.b

Re: maximum recursion depth?

2008-05-27 Thread alex23
On May 28, 9:26 am, globalrev <[EMAIL PROTECTED]> wrote: > is there a definitie limit to the nbr of calls or is the memory that > runs out? is that then the RAMmemory? is there a special amount of > memory assigned for python or it just takes and takes until windows > runs out of it? You can alter

[ANN] The Python Papers is moving to use Open Journal System

2008-05-27 Thread [EMAIL PROTECTED]
Some of our readers may be wondering about the reason why we had not put up a call for interest for our next issue, Volume 3 Issue 2. The Python Papers will always welcome interests and submissions with or without a public call; just let us know by emails. The Python Papers is nearing the end of i

maximum recursion depth?

2008-05-27 Thread globalrev
i received an error maximum recursion depth when processing large amounts of data. i dont know exactly how many recursive calls i made but id assume 5 or so. is there a definitie limit to the nbr of calls or is the memory that runs out? is that then the RAMmemory? is there a special amount o

Re: Weird exception in my, um, exception class constructor

2008-05-27 Thread Terry Reedy
"Joel Koltner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Sounds good to me. I take it that, if I don't inherit from Exception, various | expected behaviors will break? (This is what Beazley suggests...) All builtin exceptions have been in the builtin namespace for a while.

Re: Hungarian Notation

2008-05-27 Thread Dan Bishop
On May 27, 12:28 am, "inhahe" <[EMAIL PROTECTED]> wrote: > Does anybody know of a list for canonical prefixes to use for hungarian > notation in Python?  Not that I plan to name all my variables with hungarian > notation, but just for when it's appropriate. pnWe vUse adjHungarian nNotation prepAt

When was feature FOO added to Python? (was: decorators when?)

2008-05-27 Thread Ben Finney
David C. Ullrich <[EMAIL PROTECTED]> writes: > What version added decorators (using the @decorator syntax)? > > (Is there a general way I could have found out the answer myself?) For standard library features, the documentation for a module http://www.python.org/doc/lib/> usually says "(New in 2

Re: Maximum items in a list?

2008-05-27 Thread Gary Herron
Zerge wrote: Hi, Is there a theoretical limit to the number of items that can be appended to a list? thanks -- http://mail.python.org/mailman/listinfo/python-list No, only practical limits of memory, time and such. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Maximum items in a list?

2008-05-27 Thread Zerge
Hi, Is there a theoretical limit to the number of items that can be appended to a list? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Misuse of list comprehensions?

2008-05-27 Thread MRAB
On May 27, 6:43 pm, "Ian Kelly" <[EMAIL PROTECTED]> wrote: > On Tue, May 20, 2008 at 11:19 AM, John Salerno <[EMAIL PROTECTED]> wrote: > > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message > >news:[EMAIL PROTECTED] > >> After being corrected about missing the construction of a None-containing

Re: definition of a highlevel language?

2008-05-27 Thread Avowkind
On May 27, 6:34 am, [EMAIL PROTECTED] wrote: > (might not be the right forum for this but...) > > what is the definition of a highlevel-language? > > well there isnt one specifically and wikipedia and the like gives just > a very general description obv you can say it abstracts away lowlever > oper

Re: Books for learning how to write "big" programs

2008-05-27 Thread mabbikeel
On May 27, 9:58 pm, c james <[EMAIL PROTECTED]> wrote: > duli wrote: > > Hi: > > I would like recommendations for books (in any language, not > > necessarily C++, C, python) which have walkthroughs for developing > > a big software project ? So starting from inception, problem > > definition, desig

Re: call f(a, *b) with f(*a, **b) ?

2008-05-27 Thread bukzor
On May 23, 1:17 pm, bukzor <[EMAIL PROTECTED]> wrote: > On May 23, 12:35 pm, "inhahe" <[EMAIL PROTECTED]> wrote: > > > > > " > > I wish this worked:>>> def main(a,b,*argv): pass > > >>> options['argv'] = argv > > >>> main(**options) > > > TypeError: main() got an unexpected keyword argument 'argv'

Re: Books for learning how to write "big" programs

2008-05-27 Thread c james
duli wrote: Hi: I would like recommendations for books (in any language, not necessarily C++, C, python) which have walkthroughs for developing a big software project ? So starting from inception, problem definition, design, coding and final delivery on a single theme or application. Most of the

Re: Weird exception in my, um, exception class constructor

2008-05-27 Thread Joel Koltner
"Paul Hankin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] "Did you actually write self,args = args?" (looks at source code) [EMAIL PROTECTED] Why, yes, yes I did! Thanks for catching that... -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird exception in my, um, exception class constructor

2008-05-27 Thread Joel Koltner
Hi Arnaud, "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > That's because the class 'Exception' defines a descriptor 'args' which > has to be a sequence. Ah, thanks. I was following the example in Beazley's book and should have dug into the actual documentation

Re: Weird exception in my, um, exception class constructor

2008-05-27 Thread Paul Hankin
On May 27, 9:21 pm, "Joel Koltner" <[EMAIL PROTECTED]> wrote: > I have a generic (do nothing) exception class that's coded like this: > > class MyError(exceptions.Exception): >     def __init__(self,args=None): >         self.args = args > > When I attempt to raise this exception via 'raise MyError

Re: Weird exception in my, um, exception class constructor

2008-05-27 Thread Arnaud Delobelle
"Joel Koltner" <[EMAIL PROTECTED]> writes: > I have a generic (do nothing) exception class that's coded like this: > > class MyError(exceptions.Exception): > def __init__(self,args=None): > self.args = args > > When I attempt to raise this exception via 'raise MyError' I get an > excep

Weird exception in my, um, exception class constructor

2008-05-27 Thread Joel Koltner
I have a generic (do nothing) exception class that's coded like this: class MyError(exceptions.Exception): def __init__(self,args=None): self.args = args When I attempt to raise this exception via 'raise MyError' I get an exception within the MyError constructor __init__ as follows:

Re: Hungarian Notation

2008-05-27 Thread George Sakkis
On May 27, 3:43 am, Paddy <[EMAIL PROTECTED]> wrote: > On May 27, 7:42 am, "inhahe" <[EMAIL PROTECTED]> wrote: > > > Well, I just need it once in a while. Actually now is the only time I > > remember. The last time what I needed was a file name extension. I want a > > string called headers, but

Re: Why Turn "Print" into "Print()"????

2008-05-27 Thread Paddy
On May 27, 12:14 pm, Sverker Nilsson <[EMAIL PROTECTED]> wrote: > I had bothered. Volunterly that is too. Becausa I care. > > Should we piss of about py3k? It's a debate. > I suggest you try and drum up some support for your position. If you don't get much, then maybe you should reconsider your sta

Re: Hungarian Notation

2008-05-27 Thread John Salerno
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On May 27, 12:28 am, "inhahe" <[EMAIL PROTECTED]> wrote: My own knee-jerk reaction was "Hungarian Notation Bad!" and googling about for "python hungarian notation" led me through some like-minded sites. But I also found

Re: Misuse of list comprehensions?

2008-05-27 Thread Arnaud Delobelle
"Ian Kelly" <[EMAIL PROTECTED]> writes: > On Tue, May 20, 2008 at 11:19 AM, John Salerno <[EMAIL PROTECTED]> wrote: >> "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> After being corrected about missing the construction of a None-containing >>> list, one needs

Re: Python is slow

2008-05-27 Thread John Salerno
"cm_gui" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > okay, maybe Python is only slightly slower than PHP, > but it APPEARS to be much slower. > there is a distinct waiting time whenever you access a python web page > before the page starts loading. but once it loads, it is fas

Re: Misuse of list comprehensions?

2008-05-27 Thread Ian Kelly
On Tue, May 20, 2008 at 11:19 AM, John Salerno <[EMAIL PROTECTED]> wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> After being corrected about missing the construction of a None-containing >> list, one needs of course to think about the waste of resource

Re: Overloading virtual method of widget without inheriting (PyQt)

2008-05-27 Thread Francesco Bochicchio
On Tue, 27 May 2008 01:31:35 -0700, Alex Gusarov wrote: > Hello, I have strong .NET background with C# and want to do some > familiar things from it with Python, but don't know how. For example, > I created form in qt designer with QCalendarWidget, translated it into > Python module and want to ov

Re: New chairman

2008-05-27 Thread Gary Herron
Max M wrote: Sverker Nilsson skrev: I was talking about Guido van Rossum The one who decides, so far when people agree I have been using Python since the nineties. I cannot remember when I have had to rewrite old code because of changes in the language. At the same time I have been feeling

Re: New chairman

2008-05-27 Thread Max M
Sverker Nilsson skrev: I was talking about Guido van Rossum The one who decides, so far when people agree I have been using Python since the nineties. I cannot remember when I have had to rewrite old code because of changes in the language. At the same time I have been feeling as if I was s

Re: New chairman

2008-05-27 Thread Kay Schluehr
On 27 Mai, 17:21, Sverker Nilsson <[EMAIL PROTECTED]> wrote: > I was talking about Guido van Rossum > > The one who decides, so far when people agree > > But we can make a new fork > > He is the originator, but now it seems, for me, it is hanging out in > the air > > So we need some new leadership

Re: New chairman

2008-05-27 Thread Benjamin Kaplan
On Tue, May 27, 2008 at 11:48 AM, Sverker Nilsson <[EMAIL PROTECTED]> wrote: > Good luck to you to. Its just that it .. well it has never been easy > for me to introduce Python at work. This py3k, if I like it or not, is > not making it easier. > > Praktical, pragmatic, you know --- as I said, its