Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.056 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'argument': 0.05; 'explicitly': 0.05; 'subject:Python': 0.06; '__name__': 0.09; 'def': 0.12; 'question.': 0.14; "'__main__':": 0.16; 'subject:Query': 0.16; '\xa0def': 0.16; '\xa0what': 0.16; 'code.': 0.18; 'all,': 0.19; 'module': 0.19; 'lets': 0.24; 'skip:\xa0 20': 0.24; 'holds': 0.26; "i'm": 0.30; 'code': 0.31; 'class': 0.32; 'skip:_ 10': 0.34; 'classes': 0.35; '8bit%:4': 0.38; 'to:addr :python-list': 0.38; 'does': 0.39; 'flow': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; '8bit%:6': 0.40; 'different': 0.65; 'between': 0.67; 'header:Reply-To:1': 0.67; 'from:addr:yahoo.co.in': 0.68; 'received:106': 0.68; 'received:106.10': 0.68; 'received:106.10.166': 0.68; 'received:bullet.mail.sg3.yahoo.com': 0.68; 'received:mail.sg3.yahoo.com': 0.68; 'received:sg3.yahoo.com': 0.68; 'respect': 0.70; ',the': 0.84; 'received:106.10.151': 0.84 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 997264.80279.bm@omp1017.mail.sg3.yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s1024; t=1377067820; bh=YlXeLNJkfH754jtqFFhiLzq/F2XaMJclPSsFdokQQYU=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=sma62+PriKb6zdCADertfmx60Nc9C/IXmGNZaRWlLbHfAQ9w0YQA9GvhsCvS27Jnveujg5crgZPaaqv0NzvRIoL9HSqGs5+y1yoqcjqz1YRX9WLZeY9H1n8uSefS0SggcWSeGIiN2KmsTnEPpN63Y7To6GI+s+Y4e8OynSEr77g= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=W2On3rZXCmtMNOnbVtYWOfedIVIvti3UiZQ4VpZlI0gAeOo4O9TWZb9sImx+o4kYiAUT7h8U/tzSLRW/BfBiLBV1TBXZvtdWEeiX7V2F1FLzPWLNi9dLwdoHDbqmn9+hcHtf+Q9gEdhD5ZmbpMf0bGcSdjyYoOX4N6/EpP2sZ9o=; X-YMail-OSG: 62q2XesVM1mgomSd.UPfG45aQEdUUvIWTxfFMTP7TzuP22e 7WiWF77vA5LnGAS3h9ULPY9kRhFCMR.XEZUdRTNRymrfKxUa14zXVJXUkQme .1EwjFGxqFLu5m_9K0Sn36rlt.irCBoJ_8D7W2RxXZf.J5clhx6BX0p4aC67 BT.xTpuUspixBC.YTtPs4Gy1itq_qjXZHT0KW9c04qLxJL0MIAHEuO0Phoh1 ztelsn_p54ad53IdSRtWveigNgMM9MzyqVbpSq91LMLbUJgJ33C9YyjPpRlY ebrQ5hTmgb9okOoAx1zLHk14AhhZuwbMtkExUnQdiS4I6R3ruCU81S4vp4uL EmKjctNr6KpHmv1qJPs1MzdN.mUHOeQ7EdQ0gT3mnYWfSSFkIE19Xx6zWxDU 1GHdwPCbXe8zANm_L5qzbSg1VmFY1FrnWdvYlYN_4wAuQwCnL5MdxVcdZWLC Dqsic9DCJEvJkes9N3hKG7FTm7Laosc2k8jhOVT38WkpXA3NmjN.iw4WLbnH OfU0B_OUyW1fntGXM03UMHFE8KpWhWJarniOEE7P3uUTIt1ANVw-- X-Rocket-MIMEInfo: 002.001, SGkgYWxsLAoKUGxlYXNlIHNlZSB0aGUgYmVsb3cgY29kZS4KCmNsYXNzIFRlc3QodGhyZWFkaW5nLlRocmVhZCk6IMKgIMKgCsKgIMKgIMKgIGRlZiBTdGFydFRocmVhZChzZWxmKToKwqAgwqAgwqAgwqBMb2NrID0gdGhyZWFkaW5nLkxvY2soKQrCoCDCoCDCoCDCoCBzZWxmLnN0YXJ0KCkgwqDCoAoKCmNsYXNzIFRlc3QxKHRocmVhZGluZy5UaHJlYWQpOgrCoCDCoCBkZWYgX19pbml0X18oc2VsZik6CsKgIMKgIMKgIMKgIHRocmVhZGluZy5UaHJlYWQuX19pbml0X18gKCBzZWxmICkKwqAgwqAgwqAgwqAgc2UBMAEBAQE- X-Mailer: YahooMailWebService/0.8.155.576 Date: Wed, 21 Aug 2013 14:50:20 +0800 (SGT) From: chandan kumar Subject: Basic Python Query To: Python MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1197706417-1706084124-1377067820=:2408" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: chandan kumar List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 154 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1377067974 news.xs4all.nl 15979 [2001:888:2000:d::a6]:44912 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52752 ---1197706417-1706084124-1377067820=:2408 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,=0A=0APlease see the below code.=0A=0Aclass Test(threading.Thread): = =A0 =A0=0A=A0 =A0 =A0 def StartThread(self):=0A=A0 =A0 =A0 =A0Lock =3D thre= ading.Lock()=0A=A0 =A0 =A0 =A0 self.start() =A0=A0=0A=0A=0Aclass Test1(thre= ading.Thread):=0A=A0 =A0 def __init__(self):=0A=A0 =A0 =A0 =A0 threading.Th= read.__init__ ( self )=0A=A0 =A0 =A0 =A0 self.Lock =3D threading.Lock()=0As= elf.start() =A0=A0=0A=0A=0Aif __name__ =3D=3D '__main__':=0A=0A=A0 =A0 =A0 = =A0instance =3D Test()=0A=0A=A0 =A0 =A0 =A0instance.StartThread()=0A=0A=0A= =A0 =A0 =A0 =A0instance1=3D Test1()=0A=A0 =A0 =A0 =A0instance1.start()=0A= =0APlease clarify the questions below with respect to above code=0A=0A1.Dif= ference between=A0=A0def StartThread(self) and def __init__(self):=0A2=A0= =A0=A0instance =3D Test() ,when this is called ,the code flow goes inside t= he threading module ,But=A0=0A=A0 =A0 =A0 instance1=3D Test1() ,the code fl= ow goes inside the class Test1=0A=A0 =A0 =A0When we call the both classes i= n same way ,How does the flow is different for both.=0A3. Lets say self is = passed explicitly for all the methods Like=0A=A0 =A0 def method1(self)=0A= =A0 =A0 =A0 =A0 =A0method2()=0A=A0 =A0def =A0method2(self):=0A=A0 =A0 =A0 = =A0 =A0method3()=0A=A0 =A0def method(self)=0A=A0 =A0 =A0 =A0 method4()=0A= =A0 =A0def method4(self)=0A=A0What does self holds in method4 ,Is it self a= rgument from method1? Sorry i'm confused with self argument.Please clarify = if its valid question.=0A=0ABest Regards,=0AChandan ---1197706417-1706084124-1377067820=:2408 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi all= ,

Please see the below code.

class Test(threading.Threa= d):    
     = ; def StartThread(self):
    &nb= sp;  Lock =3D threading.Lock()
&= nbsp;       self.start()   

<= div style=3D"background-color: transparent; color: rgb(0, 0, 0); font-size:= 16px; font-family: 'times new roman', 'new york', times, serif; font-style= : normal;">
class Test1(threading.Thread):
    def __init__(self):
        threading.Thread.__init__ ( = self )
        self.Lock =3D threading.Lock()<= /div>
=09self.start()   

if __name__ =3D=3D '__main__':
       instance =3D Test()
       instanc= e.StartThread()

       instance1=3D Test1()
=
       instance1.start()

Please clarify the questions below with respect= to above code

1.Differe= nce between  def StartThread(self) and def __init__(self):=
  insta= nce =3D Test() ,when this is called ,the code flow goes inside the threading module ,But 
      instance= 1=3D Test1() ,the code flow goes inside the class Test1
&n= bsp;    When we call the both classes in same way ,How does the f= low is different for both.
3. Lets say self is passed expl= icitly for all the methods Like
    def method1(self)
         method2()=
   def  method2(self):
&n= bsp;        method3()
   def= method(self)
        method4()
   def method4(self)
 What does se= lf holds in method4 ,Is it self argument from method1? Sorry i'm confused w= ith self argument.Please clarify if its valid question.
Best Regards,
Chandan
= ---1197706417-1706084124-1377067820=:2408--