Python Turtle Graphics Tutorial #4 - Drawing With Mouse

preview_player
Показать описание
In this python turtle graphics tutorial I explain how to have the turtle follow your mouse. This will allow us to draw objects using our mouse on the turtle screen.

**************************************************************

**************************************************************

Please leave a LIKE and SUBSCRIBE for more content!

Tags:
- Tech With Tim
- Python Tutorials
- Turtle Module
- Python Turtle
- Python Turtle Tutorial
- Turtle Python
Рекомендации по теме
Комментарии
Автор

every episode you lower the speed and say it is the maximum speed for the turtle hahahaha
love the content. keep up great work

macaulayakin
Автор

You can also use the dir() statement to see everything turtle can do👍

fleks
Автор

thank you so much your those 4 tutorial videos of this turtle graphics, it helps me a lot
❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤

freedomvillage
Автор

I have copied the entire function but it isn't working for me. PLEASE HELP

siddhikasliwal
Автор

Sorry but I don t really undersand the purpose of that large draging function why not the following one ?:

def draging(x, y):
t.goto(x, y)

t.ondrag(draging)

unless you choose a low speed it works !!
and if that is a problem that the following one works too

def draging(x, y):
t.setheading(t.toward(x, y))
t.forward(2)

please answer my question I just can t understand that alone !!!
thanks

lousi
Автор

hi, what's the purpose of the line t.ondrag(None)? Great tutorials!

adc
Автор

for maximum speed ---> 0, in python 3.9.5 documentation

rubayetalam
Автор

vary useful helped me with a competition :D

guoqingzhou
Автор

can we smooth out the line ?, right now its very jaggy.

jayantbarthwal
Автор

Is there any way to draw without the need to hold the turtle character?

i mean, without dragging. just to click -> and draw, like in "Paint" at windows...

madafakajones
Автор

I hope you respond I have a question does this have penup also?

Donplays_
Автор

Does anyone know how to make the turtle reappear on the other side of the screen ?

JoseGonzalez-noop
Автор

You imported turtle at line 1, so you don't need to import screen and other things from turtle again

bekhruzniyazov
Автор

you video is very helpful, thank you very much

lanqing
Автор

can we use setpos instead of goto function plz tell

guptakshitij
Автор

how can i make the turtle follow my mouse without clicking or dragging?

ideology
Автор

It doesn't work...
This is the code I wrote


import turtle
from turtle import Turtle, Screen

screen = Screen()
trt = Turtle("turtle")
trt.speed(-1)

def dragging(x, y):
trt.ondrag(None)
trt.setheading(trt.towards(x, y))
trt.goto(x, y)
trt.ondrag(dragging)

def clickright():
trt.clear()

def main():
turtle.listen()
trt.ondrag(dragging)

turtle.onscreenclick(clickright(), 3)
screen.mainloop()

main()

svijayiitk
Автор

I tried to create a clone of Paint, but I don't know a way to take the thing I drew and how to save it. Is there a way and would you help me?

victortsenkov
Автор

There's any package which is capable to transform drawing inputs into straight lines, or any way to implement Hough tranform in Turtle or Tkinter drawing?

inkz
Автор

but how does the program know the co-ordinates, are x and y keywords?

invisibleimpostor