On Wed, 2008-02-06 at 00:30 -0800, frankje wrote:
> Hello,
> 
> I created the following module keer.py:
> 
> def times (x,y):
> return x*y
> 
> Now, when I am in IDLE at the prompt, and type: import keer
> And then for example: times (4,5)
> 
> I get the following message:
> 
> >>> times (4,5)
> Traceback (most recent call last):
> File "<pyshell#4>", line 1, in <module>
> times (4,5)
> NameError: name 'times' is not defined
> >>>
> 
> What am I doing wrong?

Either write:

from keer import times

or

keer.times(4,5)

armijn

-- 
---------------------------------------------------------------------------
 [EMAIL PROTECTED] | http://www.uulug.nl/ | UULug: Utrecht Linux Users Group
---------------------------------------------------------------------------

_______________________________________________
Python-nl mailing list
Python-nl@python.org
http://mail.python.org/mailman/listinfo/python-nl

Antwoord per e-mail aan