Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Problem installing turtle
#11
(Nov-10-2018, 10:41 PM)Gribouillis Wrote:
(Nov-10-2018, 10:15 PM)MasterJediKnight7 Wrote: A:\0_ingschool\Courses\Fundamentals of Algorithm\Python\Group Projects\turtle.py
This is most certainly the faulty file. Try to give another name to this file.
This code works:
from turtle import*
forward(120)
left(90)
color('red')
forward(80)
But this two I still have the problem of forward that isn't defined.
from turtle import*

while True:
    foward(1)
    left(1.15)

color("blue")
pensize(4)

for i in range(313):
    foward(2)
    left(1.15)
from turtle import*
myTurtle = turtle.Turtle()
myTurtle.circle(50)
turtle.getscreen()._root.mainloop()
Would it be because the syntax is wrong or the use of the different function incorrect?
Quote
#12
The problem is not with the code, the problem is with the file bearing the same name as the standard module turtle. After each line from turtle import *, add the line import turtle; print(turtle). It should print the path of the files that cause the problem.
Quote
#13
<module 'turtle' from 'C:\\Users\\jedi\\AppData\\Local\\Programs\\Python\\Python37\\lib\\turtle.py'>
Quote
#14
Do it in the program that doesn't work.

Also if you still have a file named turtle.py in the folder A:\0_ingschool\Courses\Fundamentals of Algorithm\Python\Group Projects\, then change its name. Choose seaturtle.py instead.
Quote
#15
For the while True program it gives me this adding the import turtle, print("turtle"):

<module 'turtle' from 'C:\\Users\\jedi\\AppData\\Local\\Programs\\Python\\Python37\\lib\\turtle.py'>
Traceback (most recent call last):
File "A:\0_ingschool\Courses\Fundamentals of Algorithm\Python\Group Projects\", line 5, in <module>
foward(1)
NameError: name 'foward' is not defined
>>>

I have changed all the names of the programs that were had "turtle" in the file .
Quote
#16
I've found the error, look carefully NameError: name 'foward' is not defined

You wrote foward instead of forward!
MasterJediKnight7 likes this post
Quote
#17
Confused Oups.
Sorry about that.
Thanks for your help.
I must have been tired.
Sorry to have taken your time for just that simple error.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Problem installing instaloader ledgreve 21 617 Nov-18-2019, 11:28 AM
Last Post: ledgreve
  Problem with installing PyPDF2 Pavel_47 2 157 Nov-10-2019, 02:58 PM
Last Post: Pavel_47
  Nested while loop problem + turtle DreamingInsanity 3 345 Jul-06-2019, 02:01 PM
Last Post: DreamingInsanity
  wn = turtle.screen() AttributeError: module 'turtle' has no attribute 'screen' Shadower 1 1,279 Feb-06-2019, 01:25 AM
Last Post: woooee
  Problem installing numpy and matplotlib achondrite 1 532 Jan-16-2019, 11:43 PM
Last Post: snippsat
  Help! Turtle not working, even when we click the turtle demo in IDLE nothing happens. BertyBee 3 600 Jan-04-2019, 02:44 AM
Last Post: SheeppOSU
  Big problem for installing PyCharm sylas 2 1,250 Nov-12-2017, 05:17 PM
Last Post: sylas
  Problem installing urlparse4 package BobLoblaw 2 2,257 Oct-06-2017, 05:16 PM
Last Post: BobLoblaw
  Turtle Problem OmarSinno 2 2,963 Sep-26-2017, 07:55 AM
Last Post: OmarSinno

Forum Jump:


Users browsing this thread: 1 Guest(s)