[BangPypers] date range

2010-02-09 Thread Kenneth Gonsalves
hi, any easy way of finding out whether a given date is between two other dates? -- regards Kenneth Gonsalves Senior Project Officer NRC-FOSS http://nrcfosshelpline.in/web/ ___ BangPypers mailing list BangPypers@python.org

Re: [BangPypers] date range

2010-02-09 Thread Rory Hart
It is nice and easy thankfully. datetime.date and datetime.datetime both support operators So: if startdate date and date enddate: print date in range http://docs.python.org/library/datetime.html On Tue, Feb 9, 2010 at 9:22 PM, Kenneth Gonsalves law...@au-kbc.org wrote: hi, any

Re: [BangPypers] date range

2010-02-09 Thread Kenneth Gonsalves
On Tuesday 09 Feb 2010 4:18:02 pm Rory Hart wrote: if startdate date and date enddate: print date in range that is what I was doing - too verbose, wanted to know if I could use 'in'. -- regards Kenneth Gonsalves Senior Project Officer NRC-FOSS http://nrcfosshelpline.in/web/

Re: [BangPypers] date range

2010-02-09 Thread Srinivas Reddy Thatiparthy
more compact is_in_range startdate date enddate I am very much interested to know how the above expression is evaluated in compiler? If the compiler evaluates left to right ,startdatedate becomes True or false depending on the values and Now, my question is how this (True/Flase enddate)

Re: [BangPypers] date range

2010-02-09 Thread Srinivas Reddy Thatiparthy
Formally, if a, b, c, ..., y, z are expressions and op1, op2, ..., opN are comparison operators, then a op1 b op2 c ... y opN z is equivalent to a op1 b and b op2 c and ... y opN z, except that each expression is evaluated at most once. Ok..Got it... Especially last sentence caught my

Re: [BangPypers] date range

2010-02-09 Thread Noufal Ibrahim
On Tue, Feb 9, 2010 at 5:07 PM, Srinivas Reddy Thatiparthy srinivas_thatipar...@akebonosoft.com wrote: Formally, if a, b, c, ..., y, z  are expressions and op1, op2, ..., opN are comparison operators, then a op1 b  op2 c ... y opN  z is equivalent to a op1 b and  b op2 c and ...  y opN z,

Re: [BangPypers] date range

2010-02-09 Thread Srinivas Reddy Thatiparthy
a b c is equivalent to a b and b c *except that* b is evaluated only once. Do mean to say that evaluating b only once applies to abc expression only. NOT for expressions like ab and bc. Regards, ~ Srini T Roshan ___ BangPypers

Re: [BangPypers] date range

2010-02-09 Thread Srinivas Reddy Thatiparthy
a b c is equivalent to a b and b c *except that* b is evaluated only once. correction Did u mean to say that evaluating b only once applies to abc expression only,NOT for expressions like ab and bc.? /correction Regards, ~ Srini T

Re: [BangPypers] date range

2010-02-09 Thread Roshan Mathews
On Tue, Feb 9, 2010 at 17:53, Srinivas Reddy Thatiparthy srinivas_thatipar...@akebonosoft.com wrote: a b c   is equivalent to   a b and b c   *except that* b is evaluated only once. correction Did u  mean to say that evaluating b only once applies to  abc expression only,NOT for

Re: [BangPypers] Trouble installing psycopg2 in Snow Leopard

2010-02-09 Thread Pradeep Gowda
On Tue, Feb 9, 2010 at 11:07 AM, Diptanu Choudhury admin.nitj...@gmail.com wrote: 2): Symbol not found: _PQbackendPID Looks like a 32/64 bit related mixup. See:http://stubblog.wordpress.com/2009/06/07/installing-psycopg2-on-osx/ Report back if you had any success.

Re: [BangPypers] Trouble installing psycopg2 in Snow Leopard

2010-02-09 Thread Diptanu Choudhury
I followed the instructions there. I get the following error now - Traceback (most recent call last): File stdin, line 1, in module File /Library/Python/2.6/site-packages/psycopg2/__init__.py, line 60, in module from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID