[Tutor] Private attributes [was Re: What on earth is happening here ???]

2012-07-25 Thread Steven D'Aprano
Prasad, Ramit wrote: Trying to make things "private" is a throwback to Java. In Python the tendency is to just leave everything "public". And "private" is with one underbar/underscore. Yes, and no. It is true that Python encourages a "consenting adults" philosophy, where private attributes a

Re: [Tutor] What on earth is happening here ???

2012-07-25 Thread Steven D'Aprano
Alan Gauld wrote: def getDOMDocument(self): def getDOMDocument(self, namespaceUri=__defaultNamespaceUri): def getDOMDocument(self, namespaceUri=__defaultNamespaceUri, qualifiedName=__defaultQualifiedName): > def getDOMDocument(self, namespaceUri=_

Re: [Tutor] What on earth is happening here ???

2012-07-25 Thread Alan Gauld
On 25/07/12 16:11, Lipska TheCat wrote: from xml.dom.minidom import getDOMImplementation I'd probably start by saying that I suspect elemtTree will be easier to use than minidom, but if you must class NpDOMDocumentFactory: # make these private "by convention" __DOMImplementa

Re: [Tutor] What on earth is happening here ???

2012-07-25 Thread Prasad, Ramit
> I have a class > The point of this class is to provide an uncluttered interface > to Document Creation > > > from xml.dom.minidom import getDOMImplementation > > class NpDOMDocumentFactory: > > """A DOM Document Factory convenience class""" > > > > # make these private "by conventi

Re: [Tutor] Getting name of Widget for event.widget?

2012-07-25 Thread Peter Otten
Leam Hall wrote: > Note that this is for an on-line class so I'd appreciate pointers to > what I need to read or think about more than the answer out right. > > Using Python 3 on Linux, is there a way to get the name of a widget > instead of numeric representations in event.widget? > > What I tr

Re: [Tutor] What on earth is happening here ???

2012-07-25 Thread Jerry Hill
On Wed, Jul 25, 2012 at 11:11 AM, Lipska TheCat wrote: > def getDOMDocument(self): This defines the method getDOMDocument(). > def getDOMDocument(self, namespaceUri=__defaultNamespaceUri): This defines the method getDOMDocument(), replacing the previous definition. > def getDOMDocu

[Tutor] What on earth is happening here ???

2012-07-25 Thread Lipska TheCat
Pythoners I have a class The point of this class is to provide an uncluttered interface to Document Creation from xml.dom.minidom import getDOMImplementation class NpDOMDocumentFactory:         """A DOM Document Factory convenience class"""          # make these private "by convention"    

Re: [Tutor] where is my MySQL database

2012-07-25 Thread Joel Goldstick
On Tue, Jul 24, 2012 at 9:58 PM, Michael Janßen wrote: > On 25 July 2012 00:51, Zhenzhen wrote: >> >> hi, I'm working on setting up my database for django by editing the >> following file: >> mysite/settings.py >> >> for the field "name", I am suppose to put down the full path of my mySQL >> data

[Tutor] Getting name of Widget for event.widget?

2012-07-25 Thread Leam Hall
Note that this is for an on-line class so I'd appreciate pointers to what I need to read or think about more than the answer out right. Using Python 3 on Linux, is there a way to get the name of a widget instead of numeric representations in event.widget? What I tried were a few variations of

Re: [Tutor] measuring the start up time of an event-driven program

2012-07-25 Thread Albert-Jan Roskam
Albert-Jan Roskam, 24.07.2012 11:18: >> I would like to test how long it takes for two versions of the same >> program to start up and be ready to receive commands. The program is >> SPSS version-very-old vs. SPSS version-latest. >> >> Normally I'd just fire the program up in a subprocess and meas