Re: MySQLdb and ordering of column names in list returned by keys() w/ a DictCursor

2009-07-02 Thread Petr Messner
2009/7/2 Tim Chase : >> Will this order at least be the same for that same query every time the >> script is executed? > > I wouldn't count on it. The order is only defined for the one iteration > (result of the keys() call). If the order matters, I'd suggest a > double-dispatch with a non-dict (

Re: Passing parameters for a C program in Linux.

2009-06-30 Thread Petr Messner
2009/6/30 venutaurus...@gmail.com : ... > Can you give some more explanation about how exactly this can be > done.. Popen object enables you to run any program in a newly-created child process, write to its standard input and read from its standard and error outputs. There is an example how your

Re: Passing parameters for a C program in Linux.

2009-06-30 Thread Petr Messner
Hi, this can be done using module "subprocess"; there is also function popen() in module "os" and module popen2, but they are deprecated since Python 2.6. PM 2009/6/30 venutaurus...@gmail.com : > Hi all, > I have to write an automted script which will test my c > program. That program whe

Re: problems with mysql db

2009-06-29 Thread Petr Messner
Hi, use %s instead of %d in SQL statements, because (AFAIK) conversions (including SQL escaping) from Python values to SQL values are done before the % operator is called - that value is not a number by that point. I hope you understood it, sorry for my English :-) You can also check MySQLdb modu

Re: The Python Way for module configuration?

2009-06-27 Thread Petr Messner
Hi, 2009/6/28 kj : ... > What I'm interested in is the general problem of providing > configuration parameters to a module. > Some database/ORM libraries are configured via simple strings in the form "dialect://user:passw...@host/dbname[?key=value..]", for example "mysql://me:topsec...@localhost/

Re: Python simple web development

2009-06-26 Thread Petr Messner
What about Werkzeug? I like its simplicity (well, basically everything I need are WSGI request/response objects :) + some templating library). Petr 2009/6/25 Private Private : > Hi, > > I am looking for a python library which will allow me to do a simple > web development. I need to use > some f