0

We have a website that uses SQL (currently SQLite3) to store entrants into a competition & the server side language is python & uses the module sqlite3. It turns out that the webhost runs python 2.4 & the module sqlite3 is only available in python 2.6/2,7 & up.

So I need to be able to write competition entrants to my SQL database in python using only python 2.4.

It would be great if I could get SSH access & install python 2.7 but ofcourse this webhost wants our business to purchase VPS access to do this & this is not possible.

I have read that I could import python SQL modules using the following code but it fails when I run this script on the website(in the CGI-bin folder):

try: 
 import sqlite3 
except ImportError: 
 from pysqlite import dbapi2 as sqlite3

I am thinking of just using MySQL because I have heard it is faster but is there a python MYSQL module & does it work on python 2.4? Do you have any advice on how I can write & store competition entries to my my SQL database in python 2.4?

asked Aug 26, 2011 at 5:33

1 Answer 1

2

Obviously you cannot use pysqlite when your webhost has not installed it. There are, of course, other libraries to access different databases, such as MySQL. If you can you those depends, again, on your webhost: He will have to install the respective database module.

Moreover, most SQL databases are standalone services that need to be installed and maintained separately.

Just ask you webhost which databases are available, if any.

By the way, "you heard MySQL is faster": For small databases this is probably wrong, as SQLite is pretty fast and might benefit from the fact that it can access data locally, whereas with MySQL, there will be some communication overhead.

answered Aug 26, 2011 at 5:48
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.