Python version of perl's "if (-T ..)" and "if (-B ...)"?

2010-02-12 Thread Lloyd Zusman
it's a -B file; otherwise it's a -T ... file. Also, any file containing null in the first block is ... considered a binary file. [ ... ] Thanks in advance for any suggestions. -- Lloyd Zusman l...@asfast.com God bless you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Working with fixed format text db's

2007-06-09 Thread Lloyd Zusman
ord takes up a specific amount of space. >> >> [ ... ] > > We already have '%-12s' to space fill for a length of 12, but it is > not truly fixed-length, as if the value has a length greater than 12 > you need it to be truncated, and this construction will not do tha

Re: subexpressions (OT: math)

2007-06-03 Thread Lloyd Zusman
t; > but they don't. That's because for arbitrary functions f and g, f(g(x)) is not equivalent to g(f(x)) This has nothing to do with whether or not x is a dimensionless number. (replace "f" with "degrees_to_radians" and "g" with "sqrt") -- Lloyd Zusman [EMAIL PROTECTED] God bless you. -- http://mail.python.org/mailman/listinfo/python-list

Re: print a ... z, A ... Z, "\n"' in Python

2007-03-03 Thread Lloyd Zusman
a string that doesn't correspond to any pre-defined constants, we're hosed. For example, there isn't a constant that would correspond to this Perl-ism: print l ... w, e ... j, L ... W, E ... J, "\n"; -- Lloyd Zusman [EMAIL PROTECTED] God bless you. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to covert ASCII to integer in Python?

2007-02-22 Thread Lloyd Zusman
ed Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> ord('i') 105 >>> chr(105) 'i' >>> IIRC, the first use of the names "ord" and "ch

Re: Joining threads but allowing signals to main thread?

2007-01-11 Thread Lloyd Zusman
Gabriel Genellina <[EMAIL PROTECTED]> writes: > At Thursday 11/1/2007 03:43, Lloyd Zusman wrote: > >> while threading.activeCount() > 1: >> time.sleep(0.001) >> >> sys.exit(0) >> >>Is there any way to allow my program to respond t

Joining threads but allowing signals to main thread?

2007-01-10 Thread Lloyd Zusman
to signals without having to busy-wait in the main thread? Thanks in advance. -- Lloyd Zusman [EMAIL PROTECTED] God bless you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommended way to force a thread context switch?

2007-01-06 Thread Lloyd Zusman
my app ... or at least it did so with the original large checkinterval. -- Lloyd Zusman [EMAIL PROTECTED] God bless you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommended way to force a thread context switch?

2007-01-06 Thread Lloyd Zusman
Duncan Booth <[EMAIL PROTECTED]> writes: > Lloyd Zusman <[EMAIL PROTECTED]> wrote: > >> I have a python (2.5) program with number of worker threads, and I want >> to make sure that each of these does a context switch at appropriate >> times, to avoid starvation

Recommended way to force a thread context switch?

2007-01-06 Thread Lloyd Zusman
ks in advance. -- Lloyd Zusman [EMAIL PROTECTED] God bless you. -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Re: SysLogHandler is drivin me nuts PEBCAC

2004-11-29 Thread Lloyd Zusman
Jan Dries <[EMAIL PROTECTED]> writes: > Slightly OT, but regarding the title, shouldn't it be PEBKAC, since it's > keyboard and not ceyboard? Your computer didn't come with a ceyboard? :) -- Lloyd Zusman [EMAIL PROTECTED] God bless you. -- http://mail.python.