2016-04-11 10 views
-1

こんにちは、私はPythonで亀を使う方法を学ぼうとしました。私はイニシャル(V T)をペイントするために以下のコードを行いましたが、黒い線を取り除く方法はわかりません。Python turtle、delete line

輸入カメ

デフdraw_myname(): ウィンドウ= turtle.Screen() window.bgcolor( "赤")あなたが持っている

#Create the V letter - Draw V 
vita = turtle.Turtle() 
vita.shape("turtle") 
vita.color("yellow") 
vita.speed(2) 
vita.right(75) 
vita.forward(100) 
vita.left(150) 
vita.forward(100) 
vita.right(75) 

#Create the T letter - Draw T 
vita = turtle.Turtle() 
vita.goto(100,0) 
vita.shape("turtle") 
vita.color("blue") 
vita.forward(5) 
vita.forward(100) 
vita.back(50) 
vita.right(90) 
vita.forward(100) 

window.exitonclick() 
draw_myname() 

enter image description here

答えて

2

turtle.up()に設定して、移動中に線を引くことはありません。移動前にvita.up()を追加し、描画準備が整ったらvita.down()を追加します。

#Create the T letter - Draw T 
vita = turtle.Turtle() 
vita.up() #add this 
vita.goto(100,0) 
vita.down() #add this 
vita.shape("turtle") 
vita.color("blue") 
vita.forward(5) 
vita.forward(100) 
vita.back(50) 
vita.right(90) 
vita.forward(100)