Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 22nd, 2006, 1:36 PM   #1
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
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!
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote
Old Oct 22nd, 2006, 2:11 PM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,069
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
The thread directly below this one.
Sane is offline   Reply With Quote
Old Oct 22nd, 2006, 6:43 PM   #3
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,472
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Oct 22nd, 2006, 9:14 PM   #4
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
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?
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote
Old Oct 23rd, 2006, 10:12 AM   #5
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,472
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Oct 23rd, 2006, 11:01 AM   #6
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
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.
Game_Ender is offline   Reply With Quote
Old Oct 23rd, 2006, 12:53 PM   #7
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
Do I need to download the actual database MySQL? That one is somewhat huge.
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote
Old Oct 23rd, 2006, 2:08 PM   #8
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,472
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Yes, unless you have access to a remote server with a MySql database.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Oct 23rd, 2006, 6:31 PM   #9
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
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.
Game_Ender is offline   Reply With Quote
Old Oct 23rd, 2006, 7:07 PM   #10
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
Quote:
Originally Posted by Game_Ender View Post
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.
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:46 AM.

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