codefly wrote: > On Dec 17, 12:43 am, "Diez B. Roggisch" <de...@nospam.web.de> wrote: >> codefly wrote: >> > error message is here.. >> > when i type import code2 >> >> > Traceback (most recent call last): >> > File "<stdin>", line 1, in <module> >> > File "code2.py", line 11 >> > ~ >> > ^ >> > SyntaxError: invalid syntax >> >> > and source code is here >> >> No, it isn't. The above error says "line 11", but the code you show >> doesn't have 11 lines. >> >> From the above error, it looks as if you have a stray "tilde"-character >> on the last or so line in code.py. Remove it. >> >> Diez > > now.. another problem.. > > when i type me = code2() > > the error is here.. > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > TypeError: 'module' object is not callable
Not surprisingly, because you try to instantiate a module. Which isn't possible. What you most probably want is me = code2.codefly() May I suggest you move your questions here: http://mail.python.org/mailman/listinfo/tutor It seems that you have some very basic misconceptions about python, so that might be a forum more geared towards your needs. Diez -- http://mail.python.org/mailman/listinfo/python-list