Re: Basic Python Query

2013-08-23 Thread Chris Angelico
On Fri, Aug 23, 2013 at 5:12 PM, Ulrich Eckhardt wrote: > Am 23.08.2013 05:28, schrieb Steven D'Aprano: >> >> On Thu, 22 Aug 2013 13:54:14 +0200, Ulrich Eckhardt wrote: >>> >>> When the Python object goes away, it doesn't necessarily affect >>> thethread or file it represents. >> >> >> That's cert

Re: Basic Python Query

2013-08-23 Thread Ulrich Eckhardt
Am 23.08.2013 05:28, schrieb Steven D'Aprano: On Thu, 22 Aug 2013 13:54:14 +0200, Ulrich Eckhardt wrote: When the Python object goes away, it doesn't necessarily affect thethread or file it represents. > That's certainly not true with file objects. When the file object goes out of scope, the u

Re: Basic Python Query

2013-08-22 Thread random832
On Thu, Aug 22, 2013, at 18:22, Dennis Lee Bieber wrote: > Well... The main thing to understand is that this particular "forum" is > NOT JUST a mailing-list. It is cross-linked with the Usenet > comp.lang.python news-group (and that, unfortunately, is cross-linked to > Google-Groups). And to

Re: Basic Python Query

2013-08-22 Thread Steven D'Aprano
On Thu, 22 Aug 2013 13:54:14 +0200, Ulrich Eckhardt wrote: > Firstly, there is one observation: The Python object of type Thread is > one thing, the actual thread is another thing. This is similar to the > File instance and the actual file. The Python object represents the > other thing (thread or

Re: Basic Python Query

2013-08-22 Thread Steven D'Aprano
On Thu, 22 Aug 2013 09:45:43 -0400, Ned Batchelder wrote: > So that I understand what's going on, what's the bad thing that happens > with a multi-part message? I would have thought that mail readers would > choose the preferred part, or is it something to do with the message > quoting? This is

Re: Basic Python Query

2013-08-22 Thread random832
On Thu, Aug 22, 2013, at 9:45, Ned Batchelder wrote: > So that I understand what's going on, what's the bad thing that happens > with a multi-part message? I would have thought that mail readers would > choose the preferred part, or is it something to do with the message > quoting? The bad thi

Re: Basic Python Query

2013-08-22 Thread Ned Batchelder
On 8/22/13 1:43 AM, Bob Martin wrote: in 704175 20130822 010625 Ned Batchelder wrote: This is a multi-part message in MIME format. Please post in plain text, not HTML. Sorry, Bob, I will try to remember in the future. I think Thunderbird is sending in the same format as the replied-to messag

Re: Basic Python Query

2013-08-22 Thread Ulrich Eckhardt
Am 21.08.2013 20:58, schrieb Johannes Bauer: On 21.08.2013 11:11, Ulrich Eckhardt wrote: That said, there is never a need for deriving from the Thread class, you can also use it to run a function without that. That way is IMHO clearer because the threading.Thread instance is not the thread, jus

Re: Basic Python Query

2013-08-22 Thread Johannes Bauer
On 22.08.2013 02:06, Ned Batchelder wrote: >> I cannot tell whether you are trolling or are just new to this, but >> you don't always have to use threads. You use threads when you need >> multiple parts of your program running concurrently. Don't inherit >> Thread if all you are doing is a simple

Re: Basic Python Query

2013-08-22 Thread Johannes Bauer
On 22.08.2013 00:50, Fábio Santos wrote: >>> That said, there is never a need for deriving >>> from the Thread class, you can also use it to run a function without >>> that. That way is IMHO clearer because the threading.Thread instance is >>> not the thread, just like a File instance is not a fil

Re: Basic Python Query

2013-08-22 Thread Fábio Santos
On 22 Aug 2013 08:58, "chandan kumar" wrote: > > Hi all, > > Sorry for not explaining question properly.Here Its not about threading and dont worry about any indentations.Please see below example > > class Call_Constructor(): > def __init__(self): > print "In __init__ " > > class Test_

Re: Basic Python Query

2013-08-22 Thread chandan kumar
ifference for both cases described above. Best Regards, Chandan. On Thu, 22/8/13, Johannes Bauer wrote: Subject: Re: Basic Python Query To: python-list@python.org Date: Thursday, 22 August, 2013, 12:28 AM On 21.08.2013 11:11, Ulrich Eckhardt wrot

Re: Basic Python Query

2013-08-21 Thread Bob Martin
in 704175 20130822 010625 Ned Batchelder wrote: >This is a multi-part message in MIME format. Please post in plain text, not HTML. -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic Python Query

2013-08-21 Thread Ned Batchelder
On 8/21/13 6:50 PM, Fábio Santos wrote: On 21 Aug 2013 20:07, "Johannes Bauer" > wrote: > > On 21.08.2013 11:11, Ulrich Eckhardt wrote: > > > That said, there is never a need for deriving > > from the Thread class, you can also use it to run a function without > >

Re: Basic Python Query

2013-08-21 Thread Fábio Santos
On 21 Aug 2013 20:07, "Johannes Bauer" wrote: > > On 21.08.2013 11:11, Ulrich Eckhardt wrote: > > > That said, there is never a need for deriving > > from the Thread class, you can also use it to run a function without > > that. That way is IMHO clearer because the threading.Thread instance is > >

Re: Basic Python Query

2013-08-21 Thread Johannes Bauer
On 21.08.2013 11:11, Ulrich Eckhardt wrote: > That said, there is never a need for deriving > from the Thread class, you can also use it to run a function without > that. That way is IMHO clearer because the threading.Thread instance is > not the thread, just like a File instance is not a file. Bo

Re: Basic Python Query

2013-08-21 Thread Ulrich Eckhardt
Am 21.08.2013 08:50, schrieb chandan kumar: class Test(threading.Thread): def StartThread(self): Lock = threading.Lock() self.start() Inconsistently indented code, this is a killer for Python. Please read PEP8 and use four spaces! That said, there is never a need for de

Re: Basic Python Query

2013-08-21 Thread Steven D'Aprano
On Wed, 21 Aug 2013 14:50:20 +0800, chandan kumar wrote: [...] > 1.Difference between  def StartThread(self) and def __init__(self): __init__ is a special method called automatically by Python when you create an instance. StartThread is a method that the author of the code (perhaps you?) wrote

Basic Python Query

2013-08-20 Thread chandan kumar
Hi all, Please see the below code. class Test(threading.Thread):           def StartThread(self):        Lock = threading.Lock()         self.start()    class Test1(threading.Thread):     def __init__(self):         threading.Thread.__init__ ( self )         self.Lock = threading.Lock() self.st