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

2010-02-12 Thread Lloyd Zusman
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
. [ ... ] 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 that. In this case, we can use '%-12.12s'. -- Lloyd Zusman [EMAIL PROTECTED] God bless

Re: subexpressions (OT: math)

2007-06-03 Thread Lloyd Zusman
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
, 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
, credits or license for more information. ord('i') 105 chr(105) 'i' IIRC, the first use of the names ord and chr for these functions appeared in the Basic language in the 1960's ... in case anyone is interested in this bit of historical trivia. -- Lloyd Zusman [EMAIL PROTECTED] God

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 to signals without having to busy-wait in the main thread? Don't worry

Joining threads but allowing signals to main thread?

2007-01-10 Thread Lloyd Zusman
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

Recommended way to force a thread context switch?

2007-01-06 Thread Lloyd Zusman
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
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. I know that I can do a time.sleep(0.001

Re: Recommended way to force a thread context switch?

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