Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Python (http://www.programmingforums.org/forum43.html)
-   -   Python and SQL (http://www.programmingforums.org/showthread.php?t=11662)

Dietrich Oct 22nd, 2006 12:36 PM

Python and SQL
 
I need some handholding here, asking for some hints to get going with an SQL database and Python. Just some information on what to download, how to connect with Python, and maybe some code examples. Hopefully something easy such as SqLite or MySQLdb. I am in the experimenting mood!

Sane Oct 22nd, 2006 1:11 PM

The thread directly below this one.

Infinite Recursion Oct 22nd, 2006 5:43 PM

MysqlDB is what you need, and I gave Bulio code to do this in the thread Sane mentions... I was experimenting with this myself, pretty cool stuff.

Dietrich Oct 22nd, 2006 8:14 PM

So what all do I have to download and install on my old HP Windows XP machine, so I can play around a little?

Also, how about SQlite, wouldn't that be a little simpler for starters?

Infinite Recursion Oct 23rd, 2006 9:12 AM

Python and MySQLdb...

This only looks hard on the surface, I downloaded MySQLdb and tinkered with the connection, search, and insert methods and had a working solution in few minutes... with a limited knowledge of Python. I'm sure you'll be able to figure it out, give it a go and see what you come up with. You could always come back for help if needed.

Game_Ender Oct 23rd, 2006 10:01 AM

Do you want to use databases? or learn how to use SQL + Python to manipulate a database. If you want to do the latter stick with the above solutions. But if you want to just use a database and not care to much about how it works you should give SQLObject or SQLAlchemy. They allow you map objects to database tables. They aren't perfect and performance won't be as good (unless you down to raw SQL) but they provide a pythonic way to access databases.

Dietrich Oct 23rd, 2006 11:53 AM

Do I need to download the actual database MySQL? That one is somewhat huge.

Infinite Recursion Oct 23rd, 2006 1:08 PM

Yes, unless you have access to a remote server with a MySql database.

Game_Ender Oct 23rd, 2006 5:31 PM

Python 2.5 comes with SQLite built in, so you don't have to go as heavy weight as MySQL if you don't need it.

Dietrich Oct 23rd, 2006 6:07 PM

Quote:

Originally Posted by Game_Ender (Post 117339)
Python 2.5 comes with SQLite built in, so you don't have to go as heavy weight as MySQL if you don't need it.

Thank you muchly! That sounds good, now I would love to have a few examples to get started.


All times are GMT -5. The time now is 12:44 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC