On 12/11/2015 17:16, Sajjadul Islam wrote:
Hello
I have coded the first snippet in python - defined a function , then I am
getting error if I try call the function from the IDLE window. The error is
:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'print_lol' is not defined
print_lol is the name of the function that is declared and defined inside
the file called nester.py and IDLE is called in the same path. What is that
I am missing here ?
Thanks
You need to either:-
import nester
nester.print_lol()
or:-
from nester import print_lol
print_lol()
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor