I suggest SyslogHandler in logging package to centralize all logs .
http://docs.python.org/library/logging.html#sysloghandler
In my opinion, rotating, parsing, filtering logs is a different task (for a
sysadmin not a developper).
I'm doing this for all my projects at work :
- using
Hi,
you can use json for passing list and dict .
Pickle is dangerous .
Instead of pickle.loads/pickle.dumps use json.loads and json.dumps
(using stdlib json in python = 2.6 or simplejson in python 2.6)
Regards
Le Thu, 18 Nov 2010 09:29:00 +0100,
Romaric DEFAUX r...@audaxis.com a écrit :
:
647648}]'
Explanation :
I dumps with json a list of dictionnaries into disk_list_json.
When I loads it, I don't get my list of dictionnaries like before (see
disk_list2). It adds u letter everywhere.
Why ?
Thanks for help !
Romaric Defaux
Le 18/11/2010 09:43, Michael Ricordeau
For scheduling, I use eventlet package and spawn_after_local .
http://eventlet.net
But you must be aware of the constraints like using monkey patched modules .
Le Mon, 18 Oct 2010 21:21:41 -0700,
TomF tomf.sess...@gmail.com a écrit :
I'm writing a simple simulator, and I want to schedule
Because is operator take precedence on operator .
Le Wed, 15 Sep 2010 05:34:06 -0700 (PDT),
Yingjie Lan lany...@yahoo.com a écrit :
Hi,
I am not sure how to interprete this, in the interactive mode:
30 is True
False
(30) is True
True
3 (0 is True)
True
Why did I get the first
--- True
#second evaluation is :
0 is True --- False (and second evaluation is not result of first one
!)
Le Wed, 15 Sep 2010 14:47:11 +0200,
Michael Ricordeau michael.ricord...@gmail.com a écrit :
Because is operator take precedence on operator .
Le Wed, 15 Sep 2010 05:34:06 -0700
# Determine diff days between two dates
import datetime
now = datetime.date(2010, 9, 28)
next = datetime.date(2010, 10, 5)
delta = next - now
#delta is datetime.timedelta type.
#(You can extract days diff)
# Determine date in 7 days
import datetime
now = datetime.date(2010, 9, 28)
delta =
Hi
You cannot add 'NOW() - '29 days'::INTERVAL' as a query because
cursor.execute() will try to mogrify it.
You can do :
import datetime
idays = psycopg2.extensions.adapt(datetime.timedelta(days=29))
self.dyndb.orderdb.query('update set creation_date=(NOW() - %s) where
id_order=%s',
Hi,
to log tracebacks, you can probably try traceback module.
I use it like this :
import traceback
# your code
for line in traceback.format_exc().splitlines():
log.trace(line)
Le Wed, 17 Mar 2010 03:42:44 -0700 (PDT),
Pakal chambon.pas...@gmail.com a écrit :
Hello
I've just