Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5222

Re: Need Assistance on this program.

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <andrea.crotti.0@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'received:134': 0.05; 'method,': 0.07; 'python': 0.07; 'bool': 0.09; 'googled': 0.09; 'header:In-reply-to:1': 0.09; 'wrong,': 0.09; 'this:': 0.11; 'written': 0.12; 'concepts.': 0.16; 'confusing.': 0.16; 'variable.': 0.16; 'code.': 0.18; 'working.': 0.19; 'command': 0.19; 'writes:': 0.20; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.20; 'programming': 0.20; 'code': 0.22; 'cc:addr:python-list': 0.22; 'calling': 0.25; 'somebody': 0.25; "i'm": 0.26; 'work.': 0.27; 'user.': 0.29; 'message-id:@gmail.com': 0.30; 'seem': 0.30; 'cc:addr:python.org': 0.31; 'invoke': 0.31; 'logic': 0.31; 'does': 0.31; 'all,': 0.31; 'called': 0.32; 'skip:" 10': 0.34; 'actually': 0.34; 'there': 0.35; 'print': 0.35; 'header:User-Agent:1': 0.35; 'point': 0.35; 'quite': 0.36; 'familiar': 0.36; 'getting': 0.36; 'some': 0.37; 'should': 0.37; 'thread': 0.38; 'but': 0.38; 'help': 0.39; 'could': 0.39; 'received:de': 0.39; 'would': 0.40; 'opened': 0.60; 'closed': 0.60; 'assistance': 0.63; 'piece': 0.63; 'attention': 0.69; 'concept': 0.73; 'peace': 0.77; 'subject:this': 0.79
MIME-version 1.0
Content-transfer-encoding 7BIT
Content-type text/plain
X-IronPort-AV E=Sophos;i="4.64,357,1301868000"; d="scan'208";a="111897450"
From Andrea Crotti <andrea.crotti.0@gmail.com>
To vijay swaminathan <swavijay@gmail.com>
Subject Re: Need Assistance on this program.
References <BANLkTi=HJ6Ve2t9=EP1sGfMbR6ZoLtgy7g@mail.gmail.com>
Date Thu, 12 May 2011 11:16:36 +0200
In-reply-to <BANLkTi=HJ6Ve2t9=EP1sGfMbR6ZoLtgy7g@mail.gmail.com>
User-Agent Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux)
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1456.1305193605.9059.python-list@python.org> (permalink)
Lines 33
NNTP-Posting-Host 82.94.164.166
X-Trace 1305193605 news.xs4all.nl 34849 [::ffff:82.94.164.166]:35884
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:5222

Show key headers only | View raw


vijay swaminathan <swavijay@gmail.com> writes:

> Hi All,
>
> I'm new bie to python thread programming and would like to assistance
> on the attached code.
>
> In this, I'm calling a thread to invoke a command prompt and would
> like to print the "Thread as alive" as long as the command prompt is
> opened and would like to print "Thread is Dead" only when the command
> prompt is closed by the user.
>
> based on my understand I have written this peace of code which does
> not seem to work. There is some flaw in the logic which I could not
> understand since I'm not that familiar with the thread concepts.
>
> Can somebody help me in getting this piece of code working.
>
> Also can somebody point me to a good tutorial on understanding python
> thread programming since I want to get my understanding on the concept
> of thread better. I googled a few but quite confusing.
>
> -- 
> Vijay Swaminathan

Easy mistake, this:
  if mythread_object.is_alive:

is wrong, since is_alive is a method, not a bool so it should be
is_alive().

Pay attention to these things, and actually something called
"is_adjective" is almost never a variable.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Need Assistance on this program. Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-05-12 11:16 +0200

csiph-web