Re: [Tutor] threads

2005-02-25 Thread Mike Bell
If what you want is something that scales up, then you're attacking the Wrong Problem. Rather than focus on getting your thread overhead as small as possible in order to support as much real-time concurrency as you can, you should (as has been suggested) try to get simulation-time concurrency

Re: [Tutor] Time Controlled Execution

2005-02-21 Thread Mike Bell
On Windows it looks like msvcrt will give you a non-blocking terminal read -- on mac / *nix systems it looks a little trickier: http://mail.python.org/pipermail/pythonmac-sig/2004-February/010140.html The os module in windows doesn't even have O_NONBLOCK. That seems like trouble. m On Sun,

Re: [Tutor] Help with error handling in a while loop

2005-02-18 Thread Mike Bell
I haven't tried the code, but it looks like you need to increment on connection failures, too. I think it's more pythonic to iterate over a range, as in the following for test_port in range(start_port, end_port) but it would suffice to just move the start_port+=1 outside of the try

Re: [Tutor] python's default argument value handling in functions - weird syntax? problem grappling with the concept

2005-02-09 Thread Mike Bell
The function's local variable L is not static, but default argument value is, which is what the documentation means when it says that it will evaluate these only once. When the default value is a list (in your code, not the empty list but a list which happens to be empty when the default

Re: [Tutor] manipulating a file

2005-02-07 Thread Mike Bell
without the explicit newlines in file.write(i), could it be that the file was closed before the write buffer was ever flushed? mike On Mon, 7 Feb 2005 14:58:03 -0500, Smith, Jeff [EMAIL PROTECTED] wrote: -Original Message- From: Alan Gauld [mailto:[EMAIL PROTECTED] Sent: Monday,

Re: [Tutor] i have a question???

2005-02-03 Thread Mike Bell
num = num + math.pi/6.0 ## Don't forget .0 or you'll get an integer the division operator returns a float when either of the operands are floats -- in this case math.pi is, so you don't have to worry about passing it 6.0 instead of 6 import math math.pi 3.1415926535897931 math.pi / 6

Re: [Tutor] Matching with beginning of the line in the character set

2005-02-01 Thread Mike Bell
Alternatively, you could .split() your string and not invoke the mechanisms dealing with regular expressions. Is this considered stylistically sloppy in the event that the split results in a very long array? Sloppier than REs are to begin with? I think that the problem with [\A\d] is that \A is