Re: Tkinter and dialogs

2006-07-08 Thread madpython
dwelch91 wrote: > I'm trying unsuccessfully to do something in Tk that I though would be > easy. It is easy. > The basic idea is that my application will consist of a series of modal > dialogs, that are chained together in "wizard" fashion. Didn't have time to get into the code you posted. Just thi

Re: Very practical question

2006-07-06 Thread madpython
Thank you all for your comments. They are priceless beyond any doubt. As for the matter of the discussion it took me only a minute looking at the code to realize that with Tkinter I pass "master" reference to every widget and therefore I can access every method in the class hierarchy. I'm a fool th

Re: Very practical question

2006-07-05 Thread madpython
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, madpython > wrote: > > > No it's not the normal way. Why don't you give `c` as argument to the > `interClassCall()`? > > class B(object): > def interClassCall(self, c): >

Very practical question

2006-07-05 Thread madpython
I've been doing an application with Tkinter widgets. Nothing really fancy just routine stuff. Though I have no problems with it by now I guess it would be reasonable to ask about a thing that's been bothering me a bit. Look at this piece of code: class A(object): def a(self): return "a

Re: How to create a limited set of instanceses of a class

2006-07-02 Thread madpython
Thanks, Alex, again. The lesson has been taught. I appreciate very much you spent time trying to help. Indeed the culprit of that infrequent infinite loops was that bound reference "item" in the printing loop. But frankly i thought that it only existed inside that loop. Apparently I was wrong and g

Re: How to create a limited set of instanceses of a class

2006-07-02 Thread madpython
Thanks Alex and Scott for your lead. It would've taken me forever trying to figure it out by myself :) I am affraid I didn't specify initially one thing and that led to a confusion: there is no need to pick an instance from the weakref dictionary, just return None if there are already 5 instances.

How to create a limited set of instanceses of a class

2006-07-01 Thread madpython
For the pure theory sake and mind expansion i got a question. Experimenting with __new__ i found out how to create a singleton. class SingleStr(object): def __new__(cls,*args,**kwargs): instance=cls.__dict__.get('instance') if instance: return instance cls.in

Re: Python database access

2006-06-26 Thread madpython
arvind wrote: > Hi all, > I am going to work on Python 2.4.3 and MSSQL database server on > Windows platform. > But I don't know how to make the connectivity or rather which module to > import. > I searched for the modules in the Python library, but I couldn't find > which module to go for. > Plea

subprocess.Popen on Windows

2006-06-23 Thread madpython
playing with subprocess.Popen on Windows I stumbled into the following problem: Python 2.4.3 (#69, Mar 29 2006, 17:35:34) IDLE 1.1.3 >>> import subprocess >>> p1=subprocess.Popen("c:\\asd.bat") #works OK >>> p2=subprocess.Popen("c:\\asd.bat",stdout=subprocess.PIPE) Traceback (most recent call la