Re: calling Postgresql stored procedure (written in plpython)

2007-06-01 Thread Alchemist
Thanks for your help.

My stored procedure is written in pythonpl.  I noticed that SELECT
queries are executed correctly (results are returned to my script)
whereas UPDATE queries are not being performed as the data is not
updated.

I am using a database user with read/write access to the database.

Is there a commit statement in plpython?  (e.g. plpy.commit())
Why are UPDATEs failing?

-- 
http://mail.python.org/mailman/listinfo/python-list


Using a web service [newbie]

2007-06-18 Thread Alchemist
I am working with Python 2.5 and would like to use of a web service.

What shall I install on my setup (or import in my Python script)?

I read about Zolera Soap Infrastructure, which seems to be the
preferred Python web service framework (http://
pywebsvcs.sourceforge.net/).  However, its documentation seems quite
old (c. 2001/2002) whilst the Babel Fish translation example (http://
livedocs.adobe.com/coldfusion/6.1/htmldocs/webserv3.htm) did not work
for me.

Are there any more recent frameworks or tools for using web services
by Python scripts?

Thank you.

-- 
http://mail.python.org/mailman/listinfo/python-list


trinary operator - if then else

2007-04-25 Thread Alchemist
What is Python's version for the trinary if..then..else operator?

I want a one-liner such as
  a?b:c
for the if..then..else control structure
if a
  then b
  else c

Does Python 2.4 support it?

-- 
http://mail.python.org/mailman/listinfo/python-list


time format

2007-05-15 Thread Alchemist
I have a ctime() object that when I convert to string returns this
string:
  "Tue May 15 12:27:11 2007"

Now I need to convert it in the following (string) format:
  "Tue, 15 May 2007 10:25:40 GMT"

How can I format a ctime() object?
Can anyone give me (or lead me to) an example of a solution to my
problem?
Thanks

-- 
http://mail.python.org/mailman/listinfo/python-list


calling Postgresql stored procedure

2007-05-30 Thread Alchemist
I am using Python 2.4 and Postgresql 8.2 database server.

On the database I have created a stored function, example,
CREATE OR REPLACE FUNCTION calculateaverage()

I created a new python script and would like to call my database
stored function.

How can I call a database stored function/procedure in python?

Thanks

-- 
http://mail.python.org/mailman/listinfo/python-list


get directory and file names

2007-07-31 Thread Alchemist
I am working with Python 2.5 on Windows XP (SP2).

How can I traverse a folder, loop through a list of files and get
their file name and extension in an elegant, pythonic way?

Thank you.

-- 
http://mail.python.org/mailman/listinfo/python-list