python: Using pysqlite 2.0 & 3.0 on the same machine

I use the beta pysqlite for some development and it works very well, highly recommended.
I also use wxMusik to listen to my music, I like it because it's open source. My beefs with wxMusik is that it doesn't have fast forward and the interface is a little confusing, although I've become used to it. One nice hidden feature of wxMusik is that it uses Sqlite for it's database (that's also why it's so fast!). Unfortunately, it's an older version of the database and pysqlite installs in only one folder. So here's what I figured out to be able to support both the old db and the new one with python.
  • Install pysqlite 2.0 normally
  • Move down _sqlite.pyd from the lib to the sqlite folder instead of the site-packages folder.
  • Download pysqlite 1.0 the exe version.
  • Instead of double clicking it open it with a zip program (it's just a zip file).
  • Extract main.py, and __init__.py and _sqlite.pyd into a site-packages\sqlite2 folder.
  • Done!
Use import pysqlite for the normal version and import pysqlite2 for the older version. More on this stuff later.

Comments

Popular posts from this blog

Shortest Sudoku solver in Python

Seven Segment Display in Inkscape

Dot to Png