views:

60

answers:

3

I'm using a linux machine to make a little python program that needs to input its result in a SQL Server 2000 DB.

I'm new to python so I'm struggling quite a bit to find what's the best solution to connect to the DB using python 3, since most of the libs I looked only work in python 2.

As an added bonus question, the finished version of this will be compiled to a windows program using py2exe. Is there anything I should be aware of, any changes to make?

Thanks

A: 

One option would be trying the pyodbc branch for python 3 support. I think some people have reported success, but you might want to inquire at the pyodbc discussion group.

If you stick to platform independent parts of the python library (most of it), you shouldn't have any issues on windows with py2exe.

ars
A: 

I can't answer your question directly, but given that many popular Python packages and frameworks are not yet fully supported on Python 3, you might consider just using Python 2.x. Unless there are features you absolutely cannot live without in Python 3, of course.

And it isn't clear from your post if you plan to deploy to Windows only, or Windows and Linux. If it's only Windows, then you should probably just develop on Windows to start with: the native MSSQL drivers are included in most recent versions so you don't have anything extra to install, and it gives you more options, such as adodbapi.

Pondlife
It's gonna be deployed to windows only. As for python 3, I don't have any problems with using 2.x, only the deadline won't allow for a change at this point...
Gabe
A: 

If you want to have portable mssql server library, you can try the module from www.pytds.com. It works with 2.5+ AND 3.1, have a good stored procedure support. It's api is more "functional", and has some good features you won't find anywhere else.

bvukov