Re: [Tutor] Importing modules/classes

2005-09-16 Thread Jacob S.
> You need to call the init method of the inherited class(es) from > within your init. It's conventional to call the superclass > constructor > before doing your own initialisation so it should look like: > >def __init__(self, num): >Thread.__init__(self) >print "__init__: Num =

Re: [Tutor] Importing modules/classes

2005-08-25 Thread Johan Geldenhuys
thread.start() AssertionError: Thread.__init__() not called >>> Which __init__ method is it referring to? Thanks in advance for your help (and time). U guys are awesome :) -Original Message- From: Danny Yoo [mailto:[EMAIL PROTECTED] Sent: Thursday, 25 August 2005 12:17 p.m.

Re: [Tutor] Importing modules/classes

2005-08-25 Thread Alan Gauld
> class show_num(threading.Thread): > >def __init__(self, num): >print "__init__: Num = ", num > > show_num_thread = show_num(742) > show_num_thread.start() > > ---><- > > Throws an error > > __init__: Num = 742 > > Traceback (most recent call last): > File "H:/Docs/PyScripts

Re: [Tutor] Importing modules/classes

2005-08-24 Thread Alan G
> Am trying to get my head around classes in python. Looks like you have the classes bit figured out! :-) > import dummy_class > d=dummy_class() But you have a problem with namespaces. the class 'dummy_class' is inside the module 'dummy_class' So when you import the module that allows you to

Re: [Tutor] Importing modules/classes

2005-08-24 Thread Hans Dushanthakumar
or your help (and time). U guys are awesome :) -Original Message- From: Danny Yoo [mailto:[EMAIL PROTECTED] Sent: Thursday, 25 August 2005 12:17 p.m. To: Hans Dushanthakumar Cc: Tutor Subject: Re: [Tutor] Importing modules/classes > class dummy_class: > def __init__(self): >

Re: [Tutor] Importing modules/classes

2005-08-24 Thread Danny Yoo
> class dummy_class: > def __init__(self): > print "__init__" > > def run(self): > print "run" > > > Now, I have another file test_dummy.py, which only has the foll 2 lines > > import dummy_class > d=dummy_class() Hi Hans, In Python, modules are containers. They can co

[Tutor] Importing modules/classes

2005-08-24 Thread Hans Dushanthakumar
Hi Am trying to get my head around classes in python. I have a file dummy_class.py with a class definition in it, as foloows class dummy_class: def __init__(self): print "__init__" def run(self): print "run" Now, I have another file test_dummy.py, which only has th