473,396 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

retrieving the return code from a spawned thread.

JY
hi all,

I would like to know how I can retrieve in my main thread (see
[A]) the
return code from a thread (see [b]) that I launched :

[b]
class example(threading.Thread):

def __init__(self, filename):
self.filename = filename
threading.Thread.__init__(self)
self.start()

def run(self):
........
rc = os.system("command example")

[A] in the main thread:
......
thrdExample = []
thrdExample.append(example(file))
......

once thrdExample[i] is not active anymore, how can I test its return
code "rc" if the main thread ??

thanks in advance,
JY
Jul 18 '05 #1
0 930

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jean-Yves Nief | last post by:
hi all, I would like to know how I can retrieve in my main program the return code from a thread that I launched: class example(threading.Thread): def __init__(self, filename): self.filename...
3
by: Tom Rahav | last post by:
Hello All, I developed a client-server file transfer application using C# for my studies. Everything works fine, but I use the follwing code (which I've found somewhere over the net) and I'm...
2
by: mb | last post by:
got the following code snippet that i've modified off the internet to work - but damn if i know how and i dont like that. im having trouble with the following thread declaration that creates the...
14
by: TT (Tom Tempelaere) | last post by:
Hi people, The code that follows throws an ExecutionEngineException. This was written in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE 7.1 (7.1.3088). The framework is .NET...
2
by: alex444 | last post by:
Hi all, I'm getting the following exception when trying to open an Access DB from the new thread: The Microsoft Jet database engine cannot open the file '\\path\errorLog.mdb'. It is already...
38
by: yomgui | last post by:
hello, is it legal to return inside a for loop or am I obliged to break out of the loop before returning ? thanks yomgui
1
by: Alvin A. Delagon | last post by:
Is there any way to fetch the Return results of spawned threads within the parent script? I would like to do that because I'm having problems with Threads that do queries to a database, I often...
11
by: Nemisis | last post by:
Hi everyone, sorry if this post gets really long, i just wanna make sure i fully explain what i am trying to do. I am new to OOP and .net 2.0, so if this is obvious, i am sorry. I have wrote a...
1
by: Vishal Sethia | last post by:
Just trying to understand the behaviour of spawn. Consider I have a function which creates two threads. And in one of the threads I make a call to pexpect.spawn. spawn would fork and create a new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.