Re: [Tutor] listing classes

2008-05-20 Thread Dave Kuhlman
On Tue, May 20, 2008 at 01:48:03PM -0400, Kent Johnson wrote: > > Note: types.ClassObj is the type of old-style classes. The OP used > new-style classes which are of type type. Using type(A) for the > comparison means it will work with either kind of classes as long as > they are the same. You cou

Re: [Tutor] Tutor Open a directory in the default file manager

2008-05-20 Thread Tony Cappellini
*Tim Michelsen* timmichelsen at gmx-topmail.de *Mon May 19 21:36:30 CEST 2008* - Previous message: [Tutor] Open a directory in the default file manager - Next message: [Tutor] Getting started with Python

[Tutor] Re Open a directory in the default file manager

2008-05-20 Thread Tony Cappellini
Message: 2 Date: Thu, 15 May 2008 20:10:05 +0200 From: Tim Michelsen <[EMAIL PROTECTED]> Subject: [Tutor] Open a directory in the default file manager To: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Hello, >>is there any function/mo

Re: [Tutor] timed functions? Timeouts?

2008-05-20 Thread Moishy Gluck
#A single " * " accepts arbitrary amount of unnamed parameters. Two " ** " accepts an arbitrary amount of unnamed parameters. # Using asterisk. def FuncOne(*list, **dict): for color in list: print color print "" for [color, value] in dict.items(): print color.ljust(

Re: [Tutor] timed functions? Timeouts?

2008-05-20 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote Then I'm a little confused by the * and ** - they look just like the pointer and pointer to a pointer in C++, but do they perform the same function in python? No, these are not pointers, they allow passing arbitrary lists and dicts of arguments. I do

Re: [Tutor] listing classes

2008-05-20 Thread Alan Gauld
"Laureano Arcanio" <[EMAIL PROTECTED]> wrote I need to have a listing of all classes defined inside a class body, something like this: class A(object): class B(object): pass class C(object): pass(object): Others have answered but I'm curious why you would want to have suc

[Tutor] Fwd: timed functions? Timeouts?

2008-05-20 Thread Kent Johnson
Forwarding to the list. -- Forwarded message -- From: W W <[EMAIL PROTECTED]> Date: Tue, May 20, 2008 at 12:31 PM Subject: Re: [Tutor] timed functions? Timeouts? To: Kent Johnson <[EMAIL PROTECTED]> On Tue, May 20, 2008 at 7:18 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: >> Then

Re: [Tutor] listing classes

2008-05-20 Thread Kent Johnson
On Tue, May 20, 2008 at 12:47 PM, Thomas Pani <[EMAIL PROTECTED]> wrote: > Hi, > > dir(A) will essentially give you what you want (and a little more) > > If you're only interested in classes, you can do something like: > > import types > [ name for name in dir(A) if type(eval('A.'+name)) == types.C

Re: [Tutor] listing classes

2008-05-20 Thread python
Thomas, > import types > [ name for name in dir(A) if type(eval('A.'+name)) == types.ClassType ] The == types.ClassType doesn't seem to pick out the classes. Also, I think you should be returning eval( name ) vs. name so that the OP gets a list of objects vs. names? (My take on what the poster w

Re: [Tutor] listing classes

2008-05-20 Thread Thomas Pani
Hi, dir(A) will essentially give you what you want (and a little more) If you're only interested in classes, you can do something like: import types [ name for name in dir(A) if type(eval('A.'+name)) == types.ClassType ] Thomas Laureano Arcanio wrote: Hi All, I need to have a listing of all

[Tutor] listing classes

2008-05-20 Thread Laureano Arcanio
Hi All, I need to have a listing of all classes defined inside a class body, something like this: class A(object): class B(object): pass class C(object): pass(object): and i need to get the classes to instantiate them.. something like this. classes =[A,B] Any ideas ? do

Re: [Tutor] timed functions? Timeouts?

2008-05-20 Thread Kent Johnson
On Mon, May 19, 2008 at 11:23 PM, W W <[EMAIL PROTECTED]> wrote: > Those examples are really helpful and I'm pretty sure they'll do what > I need, I'll just have to play with them a little more. > > I do have a question about one of the examples though! > > Specifically this part: > > 4 class Oper

Re: [Tutor] Pythoncom Tutorial

2008-05-20 Thread Alan Gauld
"FT" <[EMAIL PROTECTED]> wrote A book is nice if you can see to read it. Still searching for the best way to go on this. It was suggested to go to the API of windowes or ctypes. I confress that I have not used ctypes when just hoping to find a python format to get such things as the focus

Re: [Tutor] datetime syntax error for May 8th and 9th 2008??

2008-05-20 Thread Che M
> Date: Fri, 16 May 2008 23:38:42 -0700 > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [Tutor] datetime syntax error for May 8th and 9th 2008?? > CC: tutor@python.org > > On Fri, May 16, 2008 at 9:29 PM, John Fouhy <[EMAIL PROTECTED]> wrote: > > On 17/05/200