Newbee WinNT ODBC Question

Duncan Booth duncan at
Wed Nov 10 07:01:17 EST 1999

wayne_strauss at wrote in <809ckk$vbf$1 at>:

>I've installed Python and Win32all.exe. When I run the following (only
>the first three lines shown):
>import dbi, odbc     # ODBC modules
>import time          # standard time module
>dbc = odbc.odbc('db/id/pw')
>I get:
>>>> Traceback (innermost last):
>  File "d:\Program
>Files\Python\Pythonwin\pywin\framework\", line 237, in
>    exec codeObject in __main__.__dict__
>  File "D:\dev\Python\ODBC\", line 1, in ?
>    import dbi, odbc     # ODBC modules
>  File "", line 4, in ?
>    dbc = odbc.odbc('db/id/pw')
>TypeError: call of non-function (type module)
>If the import worked then why does the actual function call fail?

It looks rather as though you called your file so when you do 
import odbc it tries to reimport your script instead of importing the odbc 
module. Rename your source file and it should work a bit better.

More information about the Python-list mailing list