Re: [ANN] PPyGui emulator

2008-05-14 Thread Claudio Driussi
Stef Mientki wrote: I've ran the first real world application through PPyGui-emulator, so I think it's time to release the first version. There's lot of room for improvements and a more beautiful layout. PPyGui-emulator is build upon wxPython and released under BSD license. For remarks, screen

[x for x in <> while <>]?

2008-05-14 Thread urikaluzhny
It seems that I rather frequently need a list or iterator of the form [x for x in <> while <>] And there is no one like this. May be there is another short way to write it (not as a loop). Is there? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Nasty gotcha/bug in heapq.nlargest/nsmallest

2008-05-14 Thread Gabriel Genellina
En Wed, 14 May 2008 23:47:56 -0300, George Sakkis <[EMAIL PROTECTED]> escribió: > I spent several hours debugging some bogus data results that turned > out to be caused by the fact that heapq.nlargest doesn't respect rich > comparisons: > > import heapq > import random > > class X(obje

Re: Passing functions around and executing

2008-05-14 Thread Arnaud Delobelle
alex23 <[EMAIL PROTECTED]> writes: > On May 15, 10:53 am, PatrickMinnesota <[EMAIL PROTECTED]> > wrote: >> I have a bunch of functions. I want to put them in a list. Then I >> want to pass that list into another function which does some setup and >> then loops through the list of passed in funct

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread Arnaud Delobelle
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > On 14 mai, 22:44, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >> > On 14 mai, 19:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> >> __new__ is a static method! >> >> > __new__ is a special-cased

Sanitised Newsgroup Feeds?

2008-05-14 Thread Paddy
Hi, Does anyone do a sanitised newsgroup feed? Something like what mail filters do for email? It is getting tedious wading through the ads for 'cracks' & watches; as well as the Xah cross-posted self-promotions, the wx-'its easier to post than read the tutorial' annoyances and the castiro (human/E

Another BeautifulSoup crash on bad HTML

2008-05-14 Thread John Nagle
Can't really blame BeautifulSoup for this, but our crawler hit a page ("http://clagnut.com/privacy/";) with an out of range character escape: 𔃷 in this text: If you provide a name, email address and/or website and choose ‘Remember me𔃷, these details will be stored as a cookie on y

Re: generate all possible math expr of one term

2008-05-14 Thread Lew
[EMAIL PROTECTED] wrote: —Xah Lee, 2005 Blah, blah, blah. Plonk. -- Lew -- http://mail.python.org/mailman/listinfo/python-list

Recommended way to POST with cookies?

2008-05-14 Thread Gilles Ganault
Hello According to Google, there seems to be several tools available, possibly deprecated, to download data from web pages by POSTing forms and save cookies to maintain state. I need to write a script under Windows with ActivePython 2.5.1.1 that would do this: 1. Connect through a local

Re: Accepting text input

2008-05-14 Thread Kam-Hung Soh
On Thu, 15 May 2008 12:36:29 +1000, Collin <[EMAIL PROTECTED]> wrote: Kam-Hung Soh wrote: On Wed, 14 May 2008 11:02:36 +1000, Collin <[EMAIL PROTECTED]> wrote: Gabriel Genellina wrote: En Mon, 12 May 2008 01:54:28 -0300, Collin <[EMAIL PROTECTED]> escribió: Collin wrote: I'm pretty new t

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread Ivan Illarionov
On Wed, 14 May 2008 09:21:10 -0700, vbgunz wrote: > [...] > when you see > one, what is the first thing that comes to mind? When you write one, > what was the first thing on your mind? Other than "similar to static- > methods", at what point will you be glad you used one? To sum it up, > what is t

Re: Running an interactive interpreter inside a python

2008-05-14 Thread Alan J. Salmoni
I'm not sure if this is exactly what you're after, but try looking into the 'code' module. It's fairly easy to make an interactive interpreter that runs within your program. If you import your programs variables into __main__.__dict__, you can have access to them which can be funky. You can even o

Re: What's a call-tip to do?

2008-05-14 Thread Terry Reedy
"Raymond Hettinger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On May 14, 8:24 am, Tal Einat <[EMAIL PROTECTED]> wrote: > I just ran into this. In IDLE (Python 2.5), the call-tip for > itertools.count is: > "x.__init__(...) initializes x; see x.__class__.__doc__ for signature" |

Re: [off-topic] Usenet

2008-05-14 Thread Terry Reedy
"John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Wed, 14 May 2008 12:58:12 -0400 | "Terry Reedy" <[EMAIL PROTECTED]> wrote: | | > gmane.comp.python.general | > | > which is where I am answering this from. Works great. | | So that's the same as c.l.p.? It is the sa

Re: More fun with PyParsing - almost did it on my own..

2008-05-14 Thread Paul McGuire
On May 14, 6:07 pm, rh0dium <[EMAIL PROTECTED]> wrote: > Hi all, > > I almost did my first pyparsing without help but here we go again. > Let's start with my code.  The sample data is listed below. > > > > x =  cells.parseString(data) > print x[0].asDict() > > reveals > {'pins': ([(['A', 'Input'],

Running an interactive interpreter inside a python

2008-05-14 Thread R. Bernstein
The next release of pydb will have the ability to go into ipython from inside the debugger. Sort of like how in ruby-debug you can go into irb :-) For ipython, this can be done pretty simply; there is an IPShellEmbed method which returns something you can call. But how could one do the same for th

Re: Passing functions around and executing

2008-05-14 Thread alex23
On May 15, 10:53 am, PatrickMinnesota <[EMAIL PROTECTED]> wrote: > I have a bunch of functions. I want to put them in a list. Then I > want to pass that list into another function which does some setup and > then loops through the list of passed in functions and executes them. > Some of them need

Re: Accepting text input

2008-05-14 Thread John Salerno
On Thu, 15 May 2008 02:36:29 GMT Collin <[EMAIL PROTECTED]> wrote: > So the .lower() string method is just to convert the string to lowercase > letters so that you don't have to type a bunch of if - then statements > in both cases, I'm assuming? You can also type: dir(str) to get a list of al

Re: Python and Flaming Thunder

2008-05-14 Thread John Salerno
On Tue, 13 May 2008 06:25:27 -0700 (PDT) Dave Parker <[EMAIL PROTECTED]> wrote: > > I'm pretty generally interested, but where can print layout take you? > > Not far, especially with books disappearing. Our library says that > these days, only 25% of their checkouts are books; the other 75% are

Nasty gotcha/bug in heapq.nlargest/nsmallest

2008-05-14 Thread George Sakkis
I spent several hours debugging some bogus data results that turned out to be caused by the fact that heapq.nlargest doesn't respect rich comparisons: import heapq import random class X(object): def __init__(self, x): self.x=x def __repr__(self): return 'X(%s)' % self.

Re: Accepting text input

2008-05-14 Thread Collin
Kam-Hung Soh wrote: On Wed, 14 May 2008 11:02:36 +1000, Collin <[EMAIL PROTECTED]> wrote: Gabriel Genellina wrote: En Mon, 12 May 2008 01:54:28 -0300, Collin <[EMAIL PROTECTED]> escribió: Collin wrote: I'm pretty new to Python, but this has really bugged me. I can't find a way around it.

Re: Python and Flaming Thunder

2008-05-14 Thread John Salerno
On Tue, 13 May 2008 08:24:35 -0700 (PDT) Dave Parker <[EMAIL PROTECTED]> wrote: > I think that many people will find that Flaming Thunder is easier to > use and understand than Python I respectfully disagree. > Plus, me getting paid to work on Flaming Thunder is far more > motivating than me not

Re: [off-topic] Usenet

2008-05-14 Thread John Salerno
On Wed, 14 May 2008 12:58:12 -0400 "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > "Duncan Booth" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | I also recommend Gmane which provides a free news server for most mailing > | lists: mailing lists are a lot more manageable when gatew

Re: Python and Flaming Thunder

2008-05-14 Thread John Salerno
On Mon, 12 May 2008 16:39:25 -0700 (PDT) Dave Parker <[EMAIL PROTECTED]> wrote: > I've read that one of the design goals of Python was to create an easy- > to-use English-like language. That's also one of the design goals of > Flaming Thunder at http://www.flamingthunder.com/ , which has proven

Re: Using the indent method

2008-05-14 Thread Mark Tolonen
"dj" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello All, I am using elementtree to write an XML document and I am having a hard time adding the correct indentation. I have tried using the indent method, but I can not figure out how to use it. Any suggestions. Using the ver

Re: Usenet

2008-05-14 Thread Henrique Dante de Almeida
Em Wed, 14 May 2008 10:01:40 -0700, castironpi escreveu: > On May 14, 11:58 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > Love them opticals. Testing. :-P -- http://mail.python.org/mailman/listinfo/python-list

create window on panel

2008-05-14 Thread Jimmy
Hi, all I have been trying to use wxPython to design a GUI that will be displayed on the panel on the top of desktop. that is when the program starts, it will dwell on the panel to display some dynamic information. can anyone tell me in wxPython how to do this? thanks! -- http://mail.python.org/m

Re: Passing functions around and executing

2008-05-14 Thread Patrick Mullen
Here's a quick dumb example, hope it helps: def function1(a,b,c): print a,b,c def function2(x): print x def function3(y): print y+3 def executeall(list): print "setting up" for function,args in list: function(*args) #Calls the function passing in the arguments mylist = [[f

Passing functions around and executing

2008-05-14 Thread PatrickMinnesota
I've been reading the docs and looking for an answer and seem stuck. I'm either not looking in the right places or not understanding what I'm reading. I have a bunch of functions. I want to put them in a list. Then I want to pass that list into another function which does some setup and then loo

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 1:06 pm, [EMAIL PROTECTED] wrote: > On May 14, 1:02 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 12:51 pm, [EMAIL PROTECTED] wrote: > > > > On May 14, 5:25 am, [EMAIL PROTECTED] wrote: > > > > > On May 14, 4:32 am, [EMAIL PROTECTED] wrote: > > > > > > On May 13, 9:55 pm, alex23

How to subclass file

2008-05-14 Thread Yves Dorfsman
I want to create a subclass of 'file' but need to open the file with os.open (because I want to open it in exclusive mode), and need an additional method. Because I need an additional method, I truly need a object of my sublass. If I do something like class myFile(file): def __new__(cls, filen

Re: What's a call-tip to do?

2008-05-14 Thread Raymond Hettinger
On May 14, 8:24 am, Tal Einat <[EMAIL PROTECTED]> wrote: > I just ran into this. In IDLE (Python 2.5), the call-tip for > itertools.count is: > "x.__init__(...) initializes x; see x.__class__.__doc__ for signature" My IDLE (1.2.2 running on Python 2.5.2) has the correct call-tip. I don't know why

suggestions on code structuring? (classes; gui, data, methods...)

2008-05-14 Thread Vlastimil Brom
Hi all; I'd like to ask for suggestions regarding the appropriate structure of the code of my app. It is a gui program (wxPython; wx.aui) displaying several texts simultaneously. The user interface consists of multiple text widgets and control panels for selecting the text parts and synchronising.

Re: Using file objects with elementtree

2008-05-14 Thread castironpi
On May 14, 5:41 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > dj schrieb: > > > Hello, > > > Rather then holding my XML document in memory before writing it to > > disk, I want to create a file object that elementtree will write each > > element to has it is created. Does any one know how to

generate all possible math expr of one term

2008-05-14 Thread [EMAIL PROTECTED]
Here's a example of Expressiveness of a Language. The following is Mathematica code that generates all possible equations of one term involving trig function. (tweak the funList and nesting level to define what “all possible” means. if nesting level is 2, it takes about 20 minutes and returns a li

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 6:28 pm, [EMAIL PROTECTED] wrote: > On May 14, 1:22 pm, "Dan Upton" <[EMAIL PROTECTED]> wrote: > > > On Tue, May 13, 2008 at 10:55 PM, alex23 <[EMAIL PROTECTED]> wrote: > > > On May 14, 5:41 am, "inhahe" <[EMAIL PROTECTED]> wrote: > > >> "George Sakkis" <[EMAIL PROTECTED]> wrote in messa

Re: named tuple mutability

2008-05-14 Thread castironpi
On May 14, 6:21 pm, [EMAIL PROTECTED] wrote: > On May 14, 12:41 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > > > Should tuples be named? > > > Yes. > > Good; they're named sequences. Can anyone make sling-shots of words? What's the splatter? -- http://mail.python.org/mailman/listinfo/pyth

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 1:22 pm, "Dan Upton" <[EMAIL PROTECTED]> wrote: > On Tue, May 13, 2008 at 10:55 PM, alex23 <[EMAIL PROTECTED]> wrote: > > On May 14, 5:41 am, "inhahe" <[EMAIL PROTECTED]> wrote: > >> "George Sakkis" <[EMAIL PROTECTED]> wrote in message > >> > You must be new here. It is an AS (Artificial

Re: named tuple mutability

2008-05-14 Thread castironpi
On May 14, 12:41 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > Should tuples be named? > > Yes. Good; they're named sequences. -- http://mail.python.org/mailman/listinfo/python-list

Re: named tuple mutability

2008-05-14 Thread castironpi
On May 14, 5:28 pm, [EMAIL PROTECTED] wrote: > On May 14, 5:01 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > On 14 mai, 18:20, [EMAIL PROTECTED] wrote: > > > > I'm concerned over the future of Python.  Should tuples be named? > > > > Obvious

More fun with PyParsing - almost did it on my own..

2008-05-14 Thread rh0dium
Hi all, I almost did my first pyparsing without help but here we go again. Let's start with my code. The sample data is listed below. # This will gather the following ( "NamedPin" "PinDirection" "OptionalSignal" ) guts = Group( LPAR.suppress() + quotedString.setParseAction(removeQuotes).setResul

Re: Python and Flaming Thunder

2008-05-14 Thread MRAB
On May 14, 10:30 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > Dave Parker schrieb: > > > All of the calculators and textbooks that elementary school students > > > use, use "^" for powers. > > I've never seen this symbol in textbooks. In textbooks, powers are > written using superscript.

Re: Using file objects with elementtree

2008-05-14 Thread Diez B. Roggisch
dj schrieb: Hello, Rather then holding my XML document in memory before writing it to disk, I want to create a file object that elementtree will write each element to has it is created. Does any one know how to do that ? Here is my code so, far: fd = open("page.xml", "w") tree.write( fd, encod

Re: Using file objects with elementtree

2008-05-14 Thread castironpi
On May 14, 3:09 pm, dj <[EMAIL PROTECTED]> wrote: > Hello, > > Rather then holding my XML document in memory before writing it to > disk, I want to create a file object that elementtree will write each > element to has it is created. Does any one know how to do that ? > > Here is my code so, far: >

Re: named tuple mutability

2008-05-14 Thread castironpi
On May 14, 5:01 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > On 14 mai, 18:20, [EMAIL PROTECTED] wrote: > > > I'm concerned over the future of Python.  Should tuples be named? > > > Obviously not, unless they should. > > Clearly they should, unless

Re: named tuple mutability

2008-05-14 Thread Ben Finney
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > On 14 mai, 18:20, [EMAIL PROTECTED] wrote: > > I'm concerned over the future of Python. Should tuples be named? > > Obviously not, unless they should. Clearly they should, unless not. -- \ “It is seldom that liberty of any kind

Re: What's a call-tip to do?

2008-05-14 Thread Terry Reedy
"Tal Einat" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi all, | | I just ran into this. In IDLE (Python 2.5), the call-tip for | itertools.count is: | "x.__init__(...) initializes x; see x.__class__.__doc__ for signature" | | That's itertools.count.__init__.__doc__, while iter

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 22:44, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > On 14 mai, 19:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > >> __new__ is a static method! > > > __new__ is a special-cased staticmethod that 1/ must not be declared > > as such

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread Carl Banks
On May 14, 12:21 pm, vbgunz <[EMAIL PROTECTED]> wrote: > Other than the 2 reasons above (2 making more sense), what is a really > good reason to pull out the class method. In other words, when you see > one, what is the first thing that comes to mind? When you write one, > what was the first thing

Re: Python and Flaming Thunder

2008-05-14 Thread [EMAIL PROTECTED]
On 13 mai, 18:36, Dave Parker <[EMAIL PROTECTED]> wrote: (snip) > Also, in Python how do you assign a symbolic equation to a variable? > Like this? > > QuadraticEquation = a*x^2 + b*x + c = 0 quadratic_equation = lambda x, b, c : a*(x**2) + b*x + c == 0 or if x, b and c are supposed to be captur

Re: sys.excepthack...

2008-05-14 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Wed, 14 May 2008 15:47:18 -0500, "David C. Ullrich" <[EMAIL PROTECTED]> > wrote: > > [snip] > > > >Came up with a ridiculous hack involving both sys.stderr > >and sys.excepthook. Works exactly the way I want. > >

Re: Python and Flaming Thunder

2008-05-14 Thread [EMAIL PROTECTED]
> Dave Parker schrieb: > > All of the calculators and textbooks that elementary school students > > use, use "^" for powers. I've never seen this symbol in textbooks. In textbooks, powers are written using superscript. >> Just like Flaming Thunder does. I haven't > > seen "**" for powers since

Re: Python and Flaming Thunder

2008-05-14 Thread [EMAIL PROTECTED]
On 13 mai, 19:05, Dave Parker <[EMAIL PROTECTED]> wrote: > > Just to support this statement: PHP runs an order of magnitude slower than > > python. Yet a great deal (if not the majority) of dynamic sites out there > > run under PHP. All of these are unhappy customers? > > The websites owners might

"indexed properties"...

2008-05-14 Thread David C. Ullrich
Having a hard time phrasing this in the form of a question... The other day I saw a thread where someone asked about overrideable properties and nobody offered the advice that properties are Bad. So maybe we've got over that. I suppose properties could have Bad consequences if a user doesn't know

Re: sys.excepthack...

2008-05-14 Thread Jean-Paul Calderone
On Wed, 14 May 2008 15:47:18 -0500, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: [snip] Came up with a ridiculous hack involving both sys.stderr and sys.excepthook. Works exactly the way I want. Seems ridiculous - what's the right way to do this? [snip] Hi David, Take a look at the traceba

Re: Python and Flaming Thunder

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 08:08, Lie <[EMAIL PROTECTED]> wrote: > On May 14, 12:51 pm, Lie <[EMAIL PROTECTED]> wrote: > > > And your 8 by 8 cross compiler doesn't impress me at all, they're all > > based on x86/IA-32 architecture which is quite similar, no PowerPC, > > SPARC, ARM, no other CISC or RISC architectu

Re: HASH TABLES IN PYTHON

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 18:23, "Eduardo O. Padoan" <[EMAIL PROTECTED]> wrote: > On Wed, May 14, 2008 at 12:20 PM, Blubaugh, David A. > > <[EMAIL PROTECTED]> wrote: > > To Whom It May Concern, > > > I was wondering if anyone has ever worked with hash tables within the Python > > Programming language? I wonder i

sys.excepthack...

2008-05-14 Thread David C. Ullrich
Becoming a fan of wxPython, but I can't stand what it does with error messsages (I can't find a way to dismiss that window with the error message from the keyboard. Seems to be anti-modal - the key strokes that normally kill the active window kill the main window (sitting behind the window with the

Re: Python and Flaming Thunder

2008-05-14 Thread J. Cliff Dyer
On Wed, 2008-05-14 at 13:27 -0700, [EMAIL PROTECTED] wrote: > On 14 mai, 00:41, John Machin <[EMAIL PROTECTED]> wrote: > (snip) > > IIRC the idea was so that managers could write programs in English. It > > failed because nobody could write a parser that would handle something > > like "The bottom

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread Arnaud Delobelle
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > On 14 mai, 19:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> __new__ is a static method! > > __new__ is a special-cased staticmethod that 1/ must not be declared > as such and 2/ takes the class object as first args. As far as I'm > concerned,

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 16:30, George Sakkis <[EMAIL PROTECTED]> wrote: > On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > An instance method works on the instance > > > A Static method is basically a function nested within a class object > > > A class method is overkill? > > > If anyt

Re: wxpython dialog - do something after ShowModal()?

2008-05-14 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Iain King <[EMAIL PROTECTED]> wrote: > Hi. I have a modal dialog whcih has a "Browse..." button which pops > up a file selector. This all works fine, but the first thing the user > has to do when they open the dialog is select a file, so I would like > the dialo

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 19:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > George Sakkis <[EMAIL PROTECTED]> writes: > > On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > >> > An instance method works on the instance > >> > A Static method is basically a function nested within a class obj

Re: Submitting data to HTTPS javascript

2008-05-14 Thread Laszlo Nagy
John Chandler wrote: I am trying to write a script to test certain functionality of a website that requires users to login. The login page is simple, a few pictures and two text bars (one for username and one for password). I tried logging in with webbrowser, but that did not work because the

Re: named tuple mutability

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 18:20, [EMAIL PROTECTED] wrote: > I'm concerned over the future of Python. Should tuples be named? Obviously not, unless they should. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Flaming Thunder

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 00:41, John Machin <[EMAIL PROTECTED]> wrote: (snip) > IIRC the idea was so that managers could write programs in English. It > failed because nobody could write a parser that would handle something > like "The bottom line is that the stakeholder group requires the > situation going forw

enumerate() values starting at 1 vs. 0

2008-05-14 Thread python
Arnaud, >> Is there any way to have enumerate() start at 1 vs. 0? >> >> The problem with starting at 0 is that many things in the real world >> begin at 1 - like line numbers or labels in a list. > I suppose you could redefine enumerate to support an optional argument: > > from itertools import

Using file objects with elementtree

2008-05-14 Thread dj
Hello, Rather then holding my XML document in memory before writing it to disk, I want to create a file object that elementtree will write each element to has it is created. Does any one know how to do that ? Here is my code so, far: fd = open("page.xml", "w") tree.write( fd, encoding="iso-8859-

Re: Python and Flaming Thunder

2008-05-14 Thread Luis Zarrabeitia
On Tuesday 13 May 2008 01:05:38 pm Dave Parker wrote: > The websites owners might not be unhappy, but lots of customers > complain about slow websites, so if the market is competitive then > eventually the PHP fad will die out. On my [modest] experience, bandwidth trumps code speed by a large frac

Re: named tuple mutability

2008-05-14 Thread castironpi
On May 14, 1:04 pm, [EMAIL PROTECTED] wrote: > On May 14, 12:41 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > > > Should tuples be named? > > > Yes. > > Not clearly should.  Sequences ought be.  If you're on the right time > for both, can't the library hold the B? On the web, you can. Both

Re: list.__len__() or len(list)

2008-05-14 Thread Carl Banks
On May 14, 11:07 am, Nikhil <[EMAIL PROTECTED]> wrote: > Christian Heimes wrote: > > Ian Kelly schrieb: > >> The purpose of obj.__len__() is to implement len(obj), which simply > >> calls it. So obj.__len__() may be faster, but only marginally. The > >> reason to prefer len(obj) is that if you in

Re: Using the indent method

2008-05-14 Thread dj
Hello All, I am using elementtree to write an XML document and I am having a hard time adding the correct indentation. I have tried using the indent method, but I can not figure out how to use it. Any suggestions. -- http://mail.python.org/mailman/listinfo/python-list

Re: readlines with line number support?

2008-05-14 Thread Arnaud Delobelle
Nikhil <[EMAIL PROTECTED]> writes: > Arnaud Delobelle wrote: > >> The standard Python way is using enumerate() >> >> for i, line in enumerate(fp): >> print "line number: " + lineno + ": " + line.rstrip() >> > > I guess you meant to say : > > for lineno, line in enumerate(fp): > print "li

Re: readlines with line number support?

2008-05-14 Thread Nikhil
Arnaud Delobelle wrote: The standard Python way is using enumerate() for i, line in enumerate(fp): print "line number: " + lineno + ": " + line.rstrip() I guess you meant to say : for lineno, line in enumerate(fp): print "line number: " + lineno + ": " + line.rstrip() Thanks. --

Re: readlines with line number support?

2008-05-14 Thread Nikhil
Arnaud Delobelle wrote: Nikhil <[EMAIL PROTECTED]> writes: Hi, I am reading a file with readlines method of the filepointer object returned by the open function. Along with reading the lines, I also need to know which line number of the file is read in the loop everytime. I am sure, the line s

Re: readlines with line number support?

2008-05-14 Thread Nikhil
Arnaud Delobelle wrote: Nikhil <[EMAIL PROTECTED]> writes: Hi, I am reading a file with readlines method of the filepointer object returned by the open function. Along with reading the lines, I also need to know which line number of the file is read in the loop everytime. I am sure, the line s

Re: readlines with line number support?

2008-05-14 Thread Arnaud Delobelle
Nikhil <[EMAIL PROTECTED]> writes: > Hi, > > I am reading a file with readlines method of the filepointer object > returned by the open function. Along with reading the lines, I also > need to know which line number of the file is read in the loop > everytime. > I am sure, the line should have the

Re: readlines with line number support?

2008-05-14 Thread Paul McNett
Nikhil wrote: I am reading a file with readlines method of the filepointer object returned by the open function. Along with reading the lines, I also need to know which line number of the file is read in the loop everytime. I am sure, the line should have the property/attribute which will say t

readlines with line number support?

2008-05-14 Thread Nikhil
Hi, I am reading a file with readlines method of the filepointer object returned by the open function. Along with reading the lines, I also need to know which line number of the file is read in the loop everytime. I am sure, the line should have the property/attribute which will say the line n

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 1:16 pm, [EMAIL PROTECTED] wrote: > On May 14, 1:09 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 1:07 pm, [EMAIL PROTECTED] wrote: > > > > On May 14, 1:06 pm, [EMAIL PROTECTED] wrote: > > > > > On May 14, 1:02 pm, [EMAIL PROTECTED] wrote: > > > > > > On May 14, 12:51 pm, [EMAIL

Re: I'm stuck in Python!

2008-05-14 Thread Dan Upton
On Tue, May 13, 2008 at 10:55 PM, alex23 <[EMAIL PROTECTED]> wrote: > On May 14, 5:41 am, "inhahe" <[EMAIL PROTECTED]> wrote: >> "George Sakkis" <[EMAIL PROTECTED]> wrote in message >> > You must be new here. It is an AS (Artificial Stupidity) trolling bot, >> > you can safely ignore its posts. >>

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 1:09 pm, [EMAIL PROTECTED] wrote: > On May 14, 1:07 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 1:06 pm, [EMAIL PROTECTED] wrote: > > > > On May 14, 1:02 pm, [EMAIL PROTECTED] wrote: > > > > > On May 14, 12:51 pm, [EMAIL PROTECTED] wrote: > > > > > > On May 14, 5:25 am, [EMAIL

Submitting data to HTTPS javascript

2008-05-14 Thread John Chandler
I am trying to write a script to test certain functionality of a website that requires users to login. The login page is simple, a few pictures and two text bars (one for username and one for password). I tried logging in with webbrowser, but that did not work because the page uses javascript. I al

Re: SOAP/ZSI post/get for Java Web App

2008-05-14 Thread Jennifer Duerr
On May 14, 12:59 pm, Waldemar Osuch <[EMAIL PROTECTED]> wrote: > On May 13, 1:02 pm, Jennifer Duerr <[EMAIL PROTECTED]> wrote: > > > > > > > All, > > > I need help concerning SOAP, Python and XML. I am very new to this, so > > dumbing it down for me will not offend me! > > > I'm using Python and wa

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 1:07 pm, [EMAIL PROTECTED] wrote: > On May 14, 1:06 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 1:02 pm, [EMAIL PROTECTED] wrote: > > > > On May 14, 12:51 pm, [EMAIL PROTECTED] wrote: > > > > > On May 14, 5:25 am, [EMAIL PROTECTED] wrote: > > > > > > On May 14, 4:32 am, [EMAIL

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 1:06 pm, [EMAIL PROTECTED] wrote: > On May 14, 1:02 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 12:51 pm, [EMAIL PROTECTED] wrote: > > > > On May 14, 5:25 am, [EMAIL PROTECTED] wrote: > > > > > On May 14, 4:32 am, [EMAIL PROTECTED] wrote: > > > > > > On May 13, 9:55 pm, alex23

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 1:02 pm, [EMAIL PROTECTED] wrote: > On May 14, 12:51 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 5:25 am, [EMAIL PROTECTED] wrote: > > > > On May 14, 4:32 am, [EMAIL PROTECTED] wrote: > > > > > On May 13, 9:55 pm, alex23 <[EMAIL PROTECTED]> wrote: > > > > > > On May 14, 5:41 am

Re: named tuple mutability

2008-05-14 Thread castironpi
On May 14, 12:41 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > Should tuples be named? > > Yes. Not clearly should. Sequences ought be. If you're on the right time for both, can't the library hold the B? -- http://mail.python.org/mailman/listinfo/python-list

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 12:51 pm, [EMAIL PROTECTED] wrote: > On May 14, 5:25 am, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 4:32 am, [EMAIL PROTECTED] wrote: > > > > On May 13, 9:55 pm, alex23 <[EMAIL PROTECTED]> wrote: > > > > > On May 14, 5:41 am, "inhahe" <[EMAIL PROTECTED]> wrote: > > > > > > "George

Re: Python and Flaming Thunder

2008-05-14 Thread Dotan Cohen
2008/5/14 <[EMAIL PROTECTED]>: > 8x8 is pretty easy to aim for. Turn on 16x16, and you're the laptop > to stand on. FxF? I'll see your 16x16 and raise you 32x32. Any number is pretty easy to aim for when one can arbitrarily invent 2nx2n. Dotan Cohen http://what-is-what.com http://gibberish.co

Re: Python and Flaming Thunder

2008-05-14 Thread castironpi
On May 14, 8:43 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >>> That's also a myth.  For example, if C is easy to maintain, why is > >>> Flaming Thunder the only single-asset 8-by-8 shotgun cross compiler in > >>> the world?  There should be lots of single-asset 8-by-8 shotgun cross > >>> c

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 5:25 am, [EMAIL PROTECTED] wrote: > On May 14, 4:32 am, [EMAIL PROTECTED] wrote: > > > On May 13, 9:55 pm, alex23 <[EMAIL PROTECTED]> wrote: > > > > On May 14, 5:41 am, "inhahe" <[EMAIL PROTECTED]> wrote: > > > > > "George Sakkis" <[EMAIL PROTECTED]> wrote in message > > > > > You must b

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread Arnaud Delobelle
George Sakkis <[EMAIL PROTECTED]> writes: > On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> > An instance method works on the instance >> > A Static method is basically a function nested within a class object >> > A class method is overkill? >> >> If anything, a static meth

Re: list.__len__() or len(list)

2008-05-14 Thread Terry Reedy
"Nikhil" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Then why to have __len__() internal method at all when the built-in | len() is faster? Nearly all syntax constructions and builtin functions are implemented by calling one or another of the __special__ methods. This is what

Re: named tuple mutability

2008-05-14 Thread Raymond Hettinger
> Should tuples be named? Yes. -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] PPyGui emulator

2008-05-14 Thread Stef Mientki
clabepa wrote: Stef Mientki wrote: I've ran the first real world application through PPyGui-emulator, so I think it's time to release the first version. There's lot of room for improvements and a more beautiful layout. PPyGui-emulator is build upon wxPython and released under BSD license. For

Re: Purpose of operator package

2008-05-14 Thread castironpi
On May 14, 11:58 am, Matthew Woodcraft <[EMAIL PROTECTED]> wrote: > I V  <[EMAIL PROTECTED]> wrote: > > > I hadn't heard of operator.truth before. Does it do anything different > > from bool(x) ? > > Not really. It was occasionally useful before the bool type existed; > now it's just a leftover. >

Re: built in list generator?

2008-05-14 Thread Andrii V. Mishkovskyi
2008/5/14 Ethan Furman <[EMAIL PROTECTED]>: > > Ben Finney wrote: > > > Subject: Re: built in list generator? > > From: Ben Finney <[EMAIL PROTECTED]> > > Date: Wed, 14 May 2008 09:43:43 +1000 > > To: python-list@python.org > > To: python-list@python.org > > Newsgroups: comp.lang.python > > "Diez

Re: Purpose of operator package

2008-05-14 Thread Matthew Woodcraft
I V <[EMAIL PROTECTED]> wrote: > I hadn't heard of operator.truth before. Does it do anything different > from bool(x) ? Not really. It was occasionally useful before the bool type existed; now it's just a leftover. -M- -- http://mail.python.org/mailman/listinfo/python-list

Re: Usenet

2008-05-14 Thread castironpi
On May 14, 11:58 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Duncan Booth" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | I also recommend Gmane which provides a free news server for most mailing > | lists: mailing lists are a lot more manageable when gatewayed into a news

  1   2   >