> One suggestion about the above: "description" is actually the exception
> instance (the object), not just the description.
Yes. In fact, it's a tuple. Maybe, I'll change it for just printing the
second item of it.
Thanks a lot.
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen wrote:
> [EMAIL PROTECTED] wrote:
> > Nevermind. I found a better solution. I used shared memory to create
> > a keep-alive flag. I then use the select function with a specified
> > timeout, and recheck the keep-alive flag after each timeout.
>
> As Dennis points out, your original
dcrespo wrote:
> Ok, sorry about the above question. I solved it adding this to the main
> thread:
>
> try:
> SrvrTCP = module.ThreadedTCPServer(ip,port)
> SrvrTCP.start()
> except Exception, description:
> MsgBox(self,"TCPServer
> Error:\n\n"+str(description),title="TCPServer",style=w
Ok, sorry about the above question. I solved it adding this to the main
thread:
try:
SrvrTCP = module.ThreadedTCPServer(ip,port)
SrvrTCP.start()
except Exception, description:
MsgBox(self,"TCPServer
Error:\n\n"+str(description),title="TCPServer",style=wx.OK |
wx.ICON_ERROR)
return
> Now that may not be perfect, since I'm not familiar with the TCPServer()
> call. I've sort of assumed it does something quickly and returns, or
> raises an exception if the input is bad. If it doesn't actually return
> if it starts successfully, you would need a little different approach.
> Pro
Op 2005-10-18, dcrespo schreef <[EMAIL PROTECTED]>:
>> Before, after, or during the .start() call, or somewhere else?
>
> I'd like to catch *just after* the .start() call.
>
>> I'm quite sure the problem you are trying to solve can be solved, but
>> you are still describing part of the solution you
dcrespo wrote:
>>Before, after, or during the .start() call, or somewhere else?
> I'd like to catch *just after* the .start() call.
Excellent. That makes it pretty easy then, since even though you are
spawning a thread to do the work, your main thread isn't expected to
continue processing in pa
> Before, after, or during the .start() call, or somewhere else?
I'd like to catch *just after* the .start() call.
> I'm quite sure the problem you are trying to solve can be solved, but
> you are still describing part of the solution you believe you need,
> rather than explaining why you want to
dcrespo wrote:
>>Define what "get" means for your purposes. It appears that you mean you
>>want to catch the exception, but in the thread which launched the other
>>thread in the first place. If that's true, please show where you would
>>expect to catch this exception, given that when you start t
Hi Peter. Sorry for my delay. I wasn't in home the weekend.
> Define what "get" means for your purposes. It appears that you mean you
> want to catch the exception, but in the thread which launched the other
> thread in the first place. If that's true, please show where you would
> expect to cat
Steve Holden wrote:
>> Why should the coder of this software have to go through this
>> deliberate set up attrition, to get at this functionality, just
>> because it wasn't intented to be used in such a way by the
>> developers?
>>
> Because otherwise people who know no better will use the feature
Op 2005-10-17, Steve Holden schreef <[EMAIL PROTECTED]>:
> Antoon Pardon wrote:
>> Op 2005-10-17, Alex Martelli schreef <[EMAIL PROTECTED]>:
>>
>>><[EMAIL PROTECTED]> wrote:
>>>
>>>
Nevermind. I found a better solution. I used shared memory to create
a keep-alive flag. I then use the se
Steve Holden <[EMAIL PROTECTED]> writes:
> Otherwise you have to write the worker thread to be capable of
> handling asynchronous signals, which is a notoriously difficult task.
Doing it properly needs a language extension.
http://www.cs.williams.edu/~freund/papers/02-lwl2.ps
--
http://mail.pyth
Antoon Pardon wrote:
> Op 2005-10-17, Alex Martelli schreef <[EMAIL PROTECTED]>:
>
>><[EMAIL PROTECTED]> wrote:
>>
>>
>>>Nevermind. I found a better solution. I used shared memory to create
>>>a keep-alive flag. I then use the select function with a specified
>>>timeout, and recheck the keep-al
Op 2005-10-17, Alex Martelli schreef <[EMAIL PROTECTED]>:
><[EMAIL PROTECTED]> wrote:
>
>> Nevermind. I found a better solution. I used shared memory to create
>> a keep-alive flag. I then use the select function with a specified
>> timeout, and recheck the keep-alive flag after each timeout.
>
Op 2005-10-14, dcrespo schreef <[EMAIL PROTECTED]>:
> Hi all,
>
> How can I get a raised exception from other thread that is in an
> imported module?
>
> For example:
You could try the following class, it needs ctypes and if the exception
is raised while in a C-extention, the exception will be del
<[EMAIL PROTECTED]> wrote:
> Nevermind. I found a better solution. I used shared memory to create
> a keep-alive flag. I then use the select function with a specified
> timeout, and recheck the keep-alive flag after each timeout.
Definitely a better architecture. Anyway, one supported way for
Peter Hansen wrote:
> [EMAIL PROTECTED] wrote:
>
>> Nevermind. I found a better solution. I used shared memory to create
>> a keep-alive flag. I then use the select function with a specified
>> timeout, and recheck the keep-alive flag after each timeout.
>
>
> As Dennis points out, your origi
[EMAIL PROTECTED] wrote:
> Nevermind. I found a better solution. I used shared memory to create
> a keep-alive flag. I then use the select function with a specified
> timeout, and recheck the keep-alive flag after each timeout.
As Dennis points out, your original attempt was destined to fail be
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> Nevermind. I found a better solution. I used shared memory to create
> a keep-alive flag. I then use the select function with a specified
> timeout, and recheck the keep-alive flag after each timeout.
>
> Thanx for all the input.
How
Nevermind. I found a better solution. I used shared memory to create
a keep-alive flag. I then use the select function with a specified
timeout, and recheck the keep-alive flag after each timeout.
Thanx for all the input.
--
http://mail.python.org/mailman/listinfo/python-list
Here's a dumbed down version of what i'm doing:
import time
import threading
class threader(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
pass
def run(self):
try:
while 1:
time.sleep(5)
except SystemExit
[EMAIL PROTECTED] wrote:
> I also need an answer to this problem.
What _is_ the problem? We're still waiting for a clear description from
the OP as to what the problem really is. How would you describe what
_your_ problem is?
> I'm using windows. Throwing an
> exception in thread B from t
I also need an answer to this problem. I'm using windows. Throwing an
exception in thread B from thread A using a callback function.
The function runs, but the thread never actually catches the exception.
The try/except block is in the run() method (over-riden from the
Thread class)
--
http:/
dcrespo wrote:
> How can I get a raised exception from other thread that is in an
> imported module?
Define what "get" means for your purposes. It appears that you mean you
want to catch the exception, but in the thread which launched the other
thread in the first place. If that's true, please
Thanks for your answer, but I think that created thread in python
should create a thread either on windows and linux.
Can you give me Python example of how to do what I want to do? Thanks
--
http://mail.python.org/mailman/listinfo/python-list
Threads can share the same memory space.
Hence a very neat way to achieve the objective.
> For example:> > ---> programA.py> ---> > import programB
Exception=0;
> thread = programB.MakeThread()> thread.start()
if (Exception):
raise SomeException()
> ---
On non-Windows system there are a ton of ways to do it--this is almost a
whole field unto itself. :) (D-BUS, fifos, sockets, shmfs, etc.) In
Windows, I wouldn't have a clue.
I guess this is a hard question to answer without a bit more
information. :)
On Fri, 2005-10-14 at 14:45 -0700, dcrespo wr
Hi all,
How can I get a raised exception from other thread that is in an
imported module?
For example:
---
programA.py
---
import programB
thread = programB.MakeThread()
thread.start()
---
programB.py
---
import threading, time
class SomeExcept
29 matches
Mail list logo