The Python DB-API

A Python SIG has put together a DB-API standard; Mr. Kuchling gives us the details.
______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Iteration?

Anonymous's picture

I would rather do something more like this


cursor.execute(...)
for i in cursor:
   ...

clearer code

Anonymous's picture

why
while (1):
instead of
while 1:

and
if attendee == None: break
instead of
if attendee is None: break

if you want to give an example, please give a good one, not just something that works, show how to write pythonic code

I wonder if you thought at all before posting

digginestdogg's picture

Sometimes, things are not as they appear to the casual, shallow minded observer.
AMK is no 'newbie' to Python. Rather like a skilled sensei teaching young would-be samurai, he simplied his technique so as not to distract his students with complexity but rather to let them focus on his lesson one simple point at a time.

Huahweuahwa

Anonymous's picture

The real pythonic way of "saying" [if attendee is None: break]
is [if not attendee: break]
Remember, nothing is so good that can not be better . . .
If you want to correct someone, do this better next time.

Hey Andrew, nice code, your tutorial is the only link at PyGreSQL page, continue helpping people that are realy capable of learnning something.

Huahweuahwa

Anonymous's picture

The real pythonic way of "saying" [if attendee is None: break]
is [if not attendee: break]
Remember, nothing is so good that can not be better . . .
If you want to correct someone, do this better next time.

You certainly don't know who

Anonymous's picture

You certainly don't know who AMK is.

Well, as a python

Anonymous's picture

Well, as a python programmer, it could have been better, but since it's about using the API, and not how to write good python, it's still a good example.

Re: The Python DB-API

Anonymous's picture

This is useful. Thanks.

Re: The Python DB-API

Anonymous's picture

Good writing-hack. Thanx a lot, 'cause it was so useful.

LINUX POWER TO U ;o)

This is really helpful to beg

Anonymous's picture

This is really helpful to beginners to give them idea what is like DB programming with Python. Thanks!

nice :) There's a small ty

Anonymous's picture

nice :)

There's a small typo in one of the code samples where &Gt appears literally (it comes out as >>&Gt instead of >>>)

Thanks.

This is really helpful to beg

Anonymous's picture

This is really helpful to beginners to give them idea what is like DB programming with Python. Thanks!

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState