Databases

Steve Holden sholden at holdenweb.com
Fri Nov 16 10:51:30 EST 2001


[posted & mailed]

----- Original Message -----
From: "Gustavo Campanelli" <gcampanelli at ciudad.com.ar>
Newsgroups: comp.lang.python
Sent: Friday, November 16, 2001 9:21 AM
Subject: Databases


This is a really newbie question, I just started with Python 3 days ago,
and
I´m finding it quite fascinating. I don´t know how this works for you,
but I
usually learn faster when I´m trying programs, and programs come out
easier
when I´m actually doing something and not only trying to test a comand.
So
I´m trying to access a database from python. Where should I look for
documentation about using python as interface for MySQL or PostgreSQL?
Of
course, that is under Linux.
----- End Original Message -----

No "of course" about it ... I currently use MySQL (with Python) under
Windows, and it's excellent. I understand that PostgreSQL has also been
ported. However ...

You first need to understand the Python DB API, as most useful database
modules try to confirm with this. The DB Sig's pages at
http://www.python.org/sigs/db-sig/ include a database topic guide which
references this. If it all seems too complicated, then go seek out some
sample database code in Python. One such can be seen at

http://support.magma.ca/vws/unix/python.cfm

and you can find lots of others by visiting www.google.com and entering
a search string such as "Python MySQLdb example code" or something
similar.

"MySQLdb" is a crucial resource for you, since this is the module you
will need to download and install to provide MySQL support. (There's
also MyODBC, but that will represent unnecessary complexity when you are
starting out). The DB SIG pages should link you to where you can
download that module.

After that, comp.lang.python is one of the friendlier newsgroups, and
further questiosn will usually elicit a helpful response. It helps to
know what you're talking about, but even when you don't you rarely
require the "asbestos underwear"!

Good luck with MySQL!

regards
 Steve
--
http://www.holdenweb.com/








More information about the Python-list mailing list