![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
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! |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
|
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
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! |
|
|
|
|
|
#5 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
|
|
#6 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
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.
|
|
|
|
|
|
#7 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
Do I need to download the actual database MySQL? That one is somewhat huge.
__________________
I looked it up on the Intergnats! |
|
|
|
|
|
#8 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
|
|
#9 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
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.
|
|
|
|
|
|
#10 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
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! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|