0
I’m a beginner in Python and just when I went to test the Turtle module for the first time it ran normally when I was typing the commands and running at each line. However, when I saved the same commands in a proper file and ran it, an error message appeared saying that the commands were not being recognized, even though I had imported the library and it worked in the previous method. Example:
from turtle import *
fd(100)
bye()
And then comes the message "Nameerror: name 'fd' is not defined", and I’ve tried different ways to write this same code and always have a similar error. Is this an IDLE feature or am I doing something wrong?
I know it’s a very silly question but surprisingly it occurs many times... you’ve seen if your program is running in the same directory that has a file. py called "Turtle" ? If so, the error is being caused because you are importing the Turtle module from this directory and not from the Python library.
– JeanExtreme002
When you print(Turtle) before calling the function fd(100) it is returning what exactly?
– Bart
Jeanextreme002 - Yes...the file name was "Turtle",too,but now I changed and is working normally,that silly error...I would not have discovered alone, thank you very much and I’m sorry for the delay to reply.
– Mofux666
Bart - Shows "Nameerror: name 'Turtle' is not defined",but anyway, now it’s working, thanks for your attention.
– Mofux666