is Queue.Queue() serializable with cPickle?

2006-03-01 Thread john peter
i have the following custom extenstion of Queue.Queue() to save and load queue contents but I think there's a problem with it. Does anybody know qhether Queue.Queue() is pickle-able? if so, can I get sample code? If not, can anybody recommend a pickle-able Queue from another library that I migh

ANSWERED: event/job scheduling

2006-02-22 Thread john peter
H:%M'    print time.time()    s.enterabs(time.mktime(time.strptime('2006-02-22-21:15', fmt)), 1, print_time, ())    s.enterabs(time.mktime(time.strptime('2006-02-22-21:17', fmt)), 1, print_time, ())    s.enterabs(time.mktime(time.strptime('2006-02-22-21:19', fmt

event/job scheduling

2006-02-22 Thread john peter
i'd like to do the following kind of event/job scheduling: run some task(s) (python code) everyday at (say) 8am for (say) a week.i need to do this for both windows xp and suse linux machines. although i know that i can use cron or its equivalent in windows to kick off the python interpreter,

interpreting the fractional portion of time.clock() vs time.time(0 measurements

2006-02-22 Thread john peter
let's say i'm taking timing measurements in Windows XP   t1 = time.clock() ... t2 = time.clock()   t3 = t2 - t1 = say, 0.018 what is the unit of measurement for t3? is it correct to say that t3 = 18 milliseconds? microsends?   what if the timing function used for t1 and t2 was time.time()

interpreting the fractional portion of time.clock() vs time.time() measurements

2006-02-21 Thread john peter
  let's say i'm taking timing measurements in Windows XP   t1 = time.clock() ... t2 = time.clock()   t3 = t2 - t1 = say, 0.018what is the unit of measurement for t3? is it correct to say that t3 = 18 milliseconds? microseconds?  what if the ti

commenting out blocks of code

2006-02-17 Thread john peter
 in java, i can  prevent a block of code from executing by bracketing the block with comment indicators, as shown below: /*   statement1 will not execute;   statement2 will not execute; */   statement3 will executeis there a similar mechanism in python, other than prefixing the '#' char

Queue.Queue()

2006-02-17 Thread john peter
 what happens behind the scene when i create a Queue.Queue() without specifyinga maxsize?  does a block of space gets allocated initially then dynamically "expanded" as needed?  if so, what is the default size of the initial space? is italways better to specify a big enough maxsize initia

Queue.Queue()

2006-02-16 Thread john peter
 what happens behind the scenes when i create a Queue.Queue() without specifying a maxsize?  does a block of space gets allocated initially then dynamically "expanded" as needed?  if so, what is the default size of the initial space? is it always better to specify a big enough maxsize initially

logging problem on Windows XP

2006-02-15 Thread john peter
i'm using python's logging facilities in all of my application modules. my logging.conf file is: [loggers]keys=root [handlers]keys=roth [formatters]keys=simpleFormatter [logger_root]level=DEBUGhandlers=roth [handler_roth]class=handlers.RotatingFileHandlerlevel=DEBUGformatter=simpleFormatterar

file existence checking

2006-02-15 Thread john peter
does anyone have a suggestion on simplest way to check for the existence of a file within the same directory where a python script was started without really opening it? i've seen some people use this as a mechanism for informing an application of an external event, signalling it for example to

Re: FOLLOW-UP how to use RotatingFileHandler

2006-02-13 Thread john peter
the fix was to specify handler.RotatingFileHandler   does RotatingFileHandler work with Windows XP? john peter <[EMAIL PROTECTED]> wrote:Hi!   I have the following logging.conf : [loggers]keys=root   [handlers]keys=roth   [formatters]keys=simpleFormatter   [logger_root

how to use RotatingFileHandler

2006-02-13 Thread john peter
Hi!   I have the following logging.conf : [loggers]keys=root   [handlers]keys=roth   [formatters]keys=simpleFormatter   [logger_root]level=INFOhandlers=roth   [handler_roth]class=RotatingFileHandlerlevel=INFOformatter=simpleFormatterargs=('adssim.log','w', 200, 4)   [formatter_simpleFo

Re: read-only attributes

2006-02-10 Thread john peter
Thank you for the suggestion!bruno at modulix <[EMAIL PROTECTED]> wrote: limodou wrote:> On 2/10/06, john peter wrote:(snip)>> what do i have to do if i want my application code to have>>read-only>> attributes?>>> I think you may consider property() built-in

two generators working in tandem

2006-02-10 Thread john peter
I'd like to write two generators: one is a min to max sequence number generator that rolls over to min again once the max is reached. the other is a generator that cycles through N (say, 12) labels. currently, i'm using these generators in nested loops like this:   seq_numbers = genSeqNum(min,

read-only attributes

2006-02-09 Thread john peter
while reading the lib manual, i came across mentions of read-only attributes. for example, a method has a read-only attribute (called _im_self ?) for binding a class instance to the method. is such a facility available to custom application code? if so, what do i have to do if i want my applicat