Re: elementtree XML() unicode

2009-11-03 Thread Kee Nethery
On Nov 3, 2009, at 7:06 PM, Gabriel Genellina wrote: En Tue, 03 Nov 2009 23:06:58 -0300, Kee Nethery escribió: If there was a place in the official docs for me to append these nuggets of information to the sections for "xml.etree.ElementTree.XML(text)" and "xml.etree.ElementTree.dump(

Re: unittest & setup

2009-11-03 Thread Gabriel Genellina
En Wed, 04 Nov 2009 01:02:24 -0300, Jonathan Haddad escribió: I've got a class, in the constructor it loads a CSV file from disc. I'd like only 1 instance of the class to be instantiated. However, when running multiple unit tests, multiple instances of the class are created. What's the

Re: substituting list comprehensions for map()

2009-11-03 Thread Robert Kern
Steven D'Aprano wrote: On Tue, 03 Nov 2009 10:22:28 -0500, J Kenneth King wrote: Adding in the loop construct and name bindings doesn't enhance my understanding of what a dot-product is. I don't need to see the loop construct at all in this case. A dot product is simply the multiplication of

how to create nested classes dynamically

2009-11-03 Thread gopal mishra
I have class structure as below. How can I create the following nested class and its properties dynamically. class AA(object): class BB(object): def setBB1(self, value): ##some code def getBB1(self): bb1 = #somecode return bb1

Re: substituting list comprehensions for map()

2009-11-03 Thread Steven D'Aprano
On Tue, 03 Nov 2009 22:43:45 -0600, Robert Kern wrote: > Steven D'Aprano wrote: >> On Tue, 03 Nov 2009 10:22:28 -0500, J Kenneth King wrote: > >>> Adding in the loop construct and name bindings doesn't enhance my >>> understanding of what a dot-product is. I don't need to see the loop >>> constr

Re: Tkinter callback arguments

2009-11-03 Thread Steven D'Aprano
On Wed, 04 Nov 2009 02:29:21 +0100, Alf P. Steinbach wrote: >>> For example, consider two rectangle classes R1 and R2, where R2 might >>> be a successor to R1, at some point in system evolution replacing R1. >>> R1 has logical data members left, top, width and height, and R2 has >>> logical data m

Re: import from a string

2009-11-03 Thread iu2
On Nov 4, 3:10 am, "Gabriel Genellina" wrote: > En Tue, 03 Nov 2009 17:36:08 -0300, iu2 escribió: > > > > > > > On Nov 3, 7:49 pm, Matt McCredie wrote: > >> iu2 elbit.co.il> writes: > > >> > Having a file called funcs.py, I would like to read it into a string, > >> > and then import from that s

Re: how to create nested classes dynamically

2009-11-03 Thread Gabriel Genellina
En Wed, 04 Nov 2009 02:04:11 -0300, gopal mishra escribió: I have class structure as below. How can I create the following nested class and its properties dynamically. class AA(object): class BB(object): def setBB1(self, value): ##some code def getBB1(s

Re: import from a string

2009-11-03 Thread Gabriel Genellina
En Wed, 04 Nov 2009 02:45:23 -0300, iu2 escribió: On Nov 4, 3:10 am, "Gabriel Genellina" wrote: txt = """ def foo(x): print 'x=', x def bar(x): return x + x """ py> namespace = {} py> exec txt in namespace py> namespace.keys() ['__builtins__', 'foo', 'bar'] py> namespace['foo']('hell

Re: Tkinter callback arguments

2009-11-03 Thread Alf P. Steinbach
* Steven D'Aprano: On Wed, 04 Nov 2009 02:29:21 +0100, Alf P. Steinbach wrote: For example, consider two rectangle classes R1 and R2, where R2 might be a successor to R1, at some point in system evolution replacing R1. R1 has logical data members left, top, width and height, and R2 has logical

Re: disable image loading to speed up webpage load

2009-11-03 Thread elca
Diez B. Roggisch-2 wrote: > > elca schrieb: >> Hi, >> im using win32com 's webbrowser module. >> i have some question about it.. >> is it possible to disable image loading to speed up webpage load? >> any help ,much appreciate >> thanks in advance > > Use urllib2. > > Diez > -- > http://mail

Re: Tkinter callback arguments

2009-11-03 Thread Gabriel Genellina
En Wed, 04 Nov 2009 03:15:14 -0300, Alf P. Steinbach escribió: * Steven D'Aprano: On Wed, 04 Nov 2009 02:29:21 +0100, Alf P. Steinbach wrote: For example, consider two rectangle classes R1 and R2, where R2 might be a successor to R1, at some point in system evolution replacing R1. R1 has log

Re: how to remove the punctuation and no need words from paragraphs

2009-11-03 Thread Chris Rebert
On Tue, Nov 3, 2009 at 1:44 PM, kylin wrote: > I want to remove all the punctuation and no need words form a string > datasets for experiment. > > I am new to python, please give me some clue and direction to write > this code. The `replace` method of strings should get you pretty far (just repla

Re: Tkinter callback arguments

2009-11-03 Thread Peter Otten
Alf P. Steinbach wrote: > * Peter Otten: >> * Alf P. Steinbach wrote: >>> * Peter Otten: Every time someone has to read the code he will read, hesitate, read again, and then hopefully come to the conclusion that the code does nothing, consider not using it, or if it is not tied into

Re: Tkinter callback arguments

2009-11-03 Thread Alf P. Steinbach
* Gabriel Genellina: I don't understand either. R1 and R2 have *different* semantics. Assume that they have the very exact same semantics -- like two TV sets that look the same and work the same except when you open 'em up and poke around in there, oh holy cow, in this one there's stuff th

<    1   2