class

darian schramm darian.schramm at gmail.com
Thu Apr 10 14:53:24 EDT 2008


Your import statement is wrong. Try:

from Mysqldb import Mysqldb

in your session.py

On Thu, Apr 10, 2008 at 1:08 PM, Arun ragini <arunragini at gmail.com> wrote:
> Hi,
>
> I have create a class file named Mysqldb.py
>
> class Mysqldb:
>         def __init__(self, name):
>                 #this where it tries to connect to database
>                 self.ip = ip
>                 print "Inializing session for name"
>
>         def test(self):
>                 print "worked"
>
> -----------------------------------------------------
>
> now i'm trying initialize this another python file called  session.py
>
>  import Mysqldb
>
> def session():
>       Sess = Mysqldb ("localbox")
>
>
> when i try to run in using python session.py.
>
> i get error message
> TypeError: 'module' object is not callable
>
> can any 1 help me on this.
>
> Thanks & Regards
> Arun
>
>
> --
> -----
> Fight back spam! Download the Blue Frog.
> http://www.bluesecurity.com/register/s?user=YXJ1bnJhZ2luaQ%3D%3D
> --
>  http://mail.python.org/mailman/listinfo/python-list
>



-- 
Darian V Schramm



More information about the Python-list mailing list