passing object between classes
duncan.booth at invalid.invalid
Mon Sep 21 13:44:45 CEST 2009
daved170 <daved170 at gmail.com> wrote:
> Hi everybody,
> I built my owen log obj as a class.
> I'm passing it to another object (actually to a thread).
> When I run my app it raise error at the line when I'm using that log
> obj. is there any problem with the concept of passing object as I do
> How can I do that?
> class A:
> def foo1:
> myLog = cLog()
> myYhread = cThread(myLog)
> class cThread:
> def __init__(self,in_myLog):
> sel.LogObj = in_myLog
> def run():
Please always post real code and state the exact error you get. That will
maximise the chance that you get a useful answer.
The code you posted will fail for numerous reasons and I can't guess
whether you have a problem with indentation, a problem because you
misspelled 'self' as 'sel', or because you missed out the 'self' parameter
altogether on a method, or perhaps your LogObj simply doesn't have a
Duncan Booth http://kupuguy.blogspot.com
More information about the Python-list