Python Turtle Graphics Tutorial #3 - Key Presses & Events

  Рет қаралды 88,503

Tech With Tim

Tech With Tim

Күн бұрын

Пікірлер: 115
@houda9434
@houda9434 5 жыл бұрын
while True: print("Thanks Tim!") hope It runs forever
@josh_rdgrs
@josh_rdgrs 5 жыл бұрын
coolest comment I've read, so jealous.
@averageanon007
@averageanon007 5 жыл бұрын
bsod
@svijayiitk
@svijayiitk 5 жыл бұрын
Best comment lol
@kimilao5235
@kimilao5235 4 жыл бұрын
hope this comment runs forever too
@_username
@_username 3 жыл бұрын
a year later and it's still running
@FeedFall8
@FeedFall8 6 жыл бұрын
I love this channel its made everything in python more clear
@TechWithTim
@TechWithTim 6 жыл бұрын
Glad I could help!
@RoboticswithSanula
@RoboticswithSanula 3 жыл бұрын
thank you very much sir! this tutorial was great. in most videos no one teach us why we write the program like that or like this. But in your videos you explain the program step by step and it's highly appreciated...
@loneghostkitten
@loneghostkitten 3 жыл бұрын
thankies, youre a gem! I gather this better with you than in class.
@syedjafri1386
@syedjafri1386 2 жыл бұрын
Thank You!! The Best Channel to learn PYTHON!
@yeahyeah1042
@yeahyeah1042 5 жыл бұрын
Heres someing that I would recommend: Make a user input and tell the user to enter the amount of pixels they want the turtle to move. To make this work you would hsve to change the 100 in the forward to the user inputs name.
@aleclesemann1616
@aleclesemann1616 4 жыл бұрын
Tim, your the best coding master, You deserve 30million subs
@vishweshrai3126
@vishweshrai3126 Жыл бұрын
just love the way you made things very simple........thanks man
@courtneyt7497
@courtneyt7497 5 жыл бұрын
Thank you this is so helpful. I'm struggling in my class, but this has helped a lot! And a side note observation, there's a lot of annoying ads popping up throughout the video. Has anyone else noticed? More so than the previous ones. Oh well. Thanks again!
@randmorf
@randmorf 4 жыл бұрын
It seems like the first and third lines of your program are redundant. If you are using just one turtle object, you can simplify your code a lot by using 'from turtle import *' statement without the 'import turtle' statement in the first line of code. This command loads the turtle module into you default namespace, and a default turtle is set up for you. So, you won't need the statement 'tim = turtle.Turtle()' to declare your own Turtle object. Additionally, you won't need to specify your Turtle object by prefixing all your turtle commands with 'tim.'. However, if you are planning to use 2 or more turtles, you should instantiate each one using a different name and that way you can specify which turtle you want the command to act upon by using the object name ('tim.' in your example). Other than that, this was an interesting Python turtle graphics tutorial. Most such demos just show how to plot spiral or star patterns, etc. I like the direction you are going with this series.
@ashishsoni8082
@ashishsoni8082 3 жыл бұрын
Please help me with an issue! What if I wanted to creat a quiz in which I have to tell the name of the random colors that appear on the turtle screen. Then how can I execute the user input and check if the answer is correct or not. I tried to code this but the turtle stops working as I open the program. Basically, when I code the input command, the code doesn't work, otherwise it does.
@Vejinx
@Vejinx 5 жыл бұрын
This is so well done. Thank you so much for this!
@josiahscarrmusic6750
@josiahscarrmusic6750 4 жыл бұрын
Do you, by any chance know how to do a key event where when it is pressed down the turtle will move and continue to move until the key is released? I've tried onkeypress and onkeyrelease and nothing seems to work
@rubayetalam8759
@rubayetalam8759 3 жыл бұрын
thanks, Tim, want more on the turtle series.
@pv9060
@pv9060 4 жыл бұрын
How can you do the same with more than 1 turtles
@ismoilova_shahina
@ismoilova_shahina 3 жыл бұрын
Thank you. Good explanation
@varis1-m6n
@varis1-m6n 3 жыл бұрын
So like, I already defined my turtle to make easier, my issue right now is that when I put t1.speed(0) my error says "Attribute Error: 'int' object has no attribute '_speed' " What should I do?
@Re9sTwitch
@Re9sTwitch 3 жыл бұрын
Fantastic! Thanks Tim.
@lightningboy5805
@lightningboy5805 6 жыл бұрын
this is a good video about python
@swastiksarkar
@swastiksarkar 4 жыл бұрын
Module turtle has no listen member. What is it?? turtle.listen() turtle.onkey(move_left,"left")
@chessbobble1253
@chessbobble1253 4 жыл бұрын
Try capital “L”
@Δημήτρης-π2μ
@Δημήτρης-π2μ 3 жыл бұрын
Thank you man, your video help me a lot. Respect 🔥🔥
@Senseileon
@Senseileon 5 жыл бұрын
I've copied this in python 3.7.2 but it doesn't work any help
@slickish8845
@slickish8845 5 жыл бұрын
same
@kairon5249
@kairon5249 4 жыл бұрын
@Frank Enga how to do this with the mouse?
@illusion_______
@illusion_______ 3 жыл бұрын
Is there a way to detect if a key is not pressed?
@conermos
@conermos 4 жыл бұрын
Thanks so much. website code also helped a lot.
@michaelpowell773
@michaelpowell773 5 жыл бұрын
Thanks for the tutorial, although my programme kept saying invalid type when I tried to use "turtle.listen". Can you help me, please?
@aldrinjenson
@aldrinjenson 5 жыл бұрын
Try turtle.listen()
@mafizulhaque8306
@mafizulhaque8306 4 жыл бұрын
This helped me. Thank you!
@theedspage
@theedspage 3 жыл бұрын
Thank you. Well done.
@fookwailau8306
@fookwailau8306 3 жыл бұрын
hello, I am trying to follow the tutorial but I always face this error once I click run: AttributeError: 'Turtle' object has no attribute 'listen' for the line turtle.listen() may I know what do I need to do to fix this? I have basically tried everything, but still can't fix it, thank you!
@matoshreexerox9340
@matoshreexerox9340 4 жыл бұрын
i had a doubt, how can i assign a function to 2 keys when pressed together
@arii4514
@arii4514 4 жыл бұрын
I did everything but i got a blank turtle graphic
@ljessante4997
@ljessante4997 4 жыл бұрын
Help, it says " 'int' object has no attribute '_speed' ", what do I do
@brianwool5703
@brianwool5703 4 жыл бұрын
Had the same problem. Replying so more people see this
@ledung907
@ledung907 5 жыл бұрын
why do we need to put the two parameters in clickright and clickleft function ?
@akiranorakage3675
@akiranorakage3675 4 жыл бұрын
Thanks for he lesson, it really helped! 👍
@Wtwisb26
@Wtwisb26 3 жыл бұрын
Thx my brother 👍❤️
@hp_entertainments
@hp_entertainments 5 жыл бұрын
if i want to create two different objects which will move on press of two different keys
@serinded8677
@serinded8677 6 жыл бұрын
What do you need to use for number presses?
@myperspective5091
@myperspective5091 6 жыл бұрын
That reminded me of making basic games in Scratch. Is this turtle module done in Pygame?
@TechWithTim
@TechWithTim 6 жыл бұрын
Nope, it comes with a default python installation.
@tamashee6625
@tamashee6625 5 жыл бұрын
Thank you so much for this great video. It helped a lot.
@garrettallred6531
@garrettallred6531 5 жыл бұрын
every time i try and run it it keeps closing. the only way i know how to stop it from doing that is by adding an input(" ") but when i do that i get the terminal in the background.
@Lucasafari89
@Lucasafari89 4 жыл бұрын
How i pass values for functions parameters without using global .?? def oce( a, b) : Print(a ,b) turtle.onclick( oce ( a = 1 , b = 2 )) turtle.listen() I tried like this turtle.onvlick ( lamda : oev(a = 1 , b = 2 ) ) But it say : take 0 arguments but 3 where given Help ...
@bakhtiyormirzo
@bakhtiyormirzo 3 жыл бұрын
are you making any other tutorial?
@userdetails1
@userdetails1 4 жыл бұрын
I added a function and a listener for when the user clicks the turtle. But it only works if you click the turtle's starting position (ie 0,0) regardless where the turtle moves to. This is what I added: def click_left_turtle(x, y): print("You clicked turtle") turtle.listen() turtle.onclick(click_left_turtle, 1)
@solomon9388
@solomon9388 3 жыл бұрын
why are there 2 arrows?
@KING-zz6qt
@KING-zz6qt 4 жыл бұрын
Hi, great video! I'm just interested how to remove a binding once it is set?
@flaminfox7405
@flaminfox7405 4 жыл бұрын
Me: sees an add about beginner coding app that costs money. also me: But i have Tech With Tim??
@funk.y-o2y
@funk.y-o2y 5 жыл бұрын
Stupid question but how do your make your text so large in pycharm, do you just change the font size?
@ingusterbang_
@ingusterbang_ 4 жыл бұрын
you do it on .py. can it work at .ttl?
@mshimanshu1000
@mshimanshu1000 4 жыл бұрын
turtle.listen() the very moment I executed the program after writing this command it gave me an error like : AttributeError: 'Turtle' object has no attribute 'listen' on line 22 please help.......
@shivamchowdhary190
@shivamchowdhary190 3 жыл бұрын
make sure you import turtle or from turtle import * at the beginning!
@mshimanshu1000
@mshimanshu1000 3 жыл бұрын
@@shivamchowdhary190 aaay thanks bro
@emersonlyle4236
@emersonlyle4236 4 жыл бұрын
I don't know if anyone else is having this problem, but i think my turtle has been updated or something and now it gives me an error message about how certain functions are not in use, yada yada yada. Does anyone know how to solve that?
@rishabhgautam7863
@rishabhgautam7863 5 жыл бұрын
what does that stamp() function do?
@fatboydga
@fatboydga 3 жыл бұрын
its not working for me in IDLE
@JorSenpai
@JorSenpai 5 жыл бұрын
hey time how to keep the arrow moving while i'm pressing Thanks for the tutorials
@pythonforkids9180
@pythonforkids9180 4 жыл бұрын
I have a question, Tim, when I run this code the turtle window does not respond do you know why that is?
@chasehightower5790
@chasehightower5790 4 жыл бұрын
change the variable of 'tim' to 'turtle' and it should work
@pythonforkids9180
@pythonforkids9180 4 жыл бұрын
it is turtle already, not tim
@notanshul1860
@notanshul1860 5 жыл бұрын
it returns an error saying turtle has no attribute "Turtle"
@ricardosouza7328
@ricardosouza7328 4 жыл бұрын
I made a turtle but isn't correct anything, you can see them and find where is the mistake
@aagaya_verma
@aagaya_verma 5 жыл бұрын
why you used parameters
@oydeteros5850
@oydeteros5850 2 жыл бұрын
Perfect!
@cristianherendi1762
@cristianherendi1762 5 жыл бұрын
I wrote every thing letter for letter and it did not work >=(
@gillianorley
@gillianorley 5 жыл бұрын
Why didn’t they make up 0 and down 180? That would be more like compass headings.
@vwchampTube
@vwchampTube 5 жыл бұрын
Because it’s less like compass headings and more like the degree circle. Where the positive X direction is 0° and you work your way counter-clockwise for 360° which brings you back where you started. This is fundamental in geometry and trigonometry! :D
@gillianorley
@gillianorley 5 жыл бұрын
Irony TP Thanks.
@circular747
@circular747 3 жыл бұрын
can sum1plz tell me the list of Color so I can paste it (:
@IAMSAEID
@IAMSAEID 5 жыл бұрын
mine just shows Error at onkey, my PyCharm says what the f... is this???
@grayson9075
@grayson9075 4 жыл бұрын
Cool bro
@artlfact_
@artlfact_ 4 жыл бұрын
hey tim :) I encountered a problem while running this code. Every time after I closes the turtle window and restart the programm, I get a turtle.terminator error. Do you know why this happens? I found the solution online to just add the following boolean variable to the start of your programm: turtle.TurtleScreen._RUNNING = True This worked for me, but it felt kind of random and out of place.
@udayansinghal7238
@udayansinghal7238 4 жыл бұрын
For me it says turtle has no atribbute turtle
@ibrahimshakil2375
@ibrahimshakil2375 4 жыл бұрын
Bro i am getting this error :- " AttributeError: 'Turtle' object has no attribute 'listen' on line 30 " Please HELP ......
@chomp6903
@chomp6903 4 жыл бұрын
Hello, it has to be a screen turtle. Try ts=turtle.Screen() and ts.listen()
@shivamshandilya5059
@shivamshandilya5059 4 жыл бұрын
Hey Tim! i want to execute something when the value a variable changes so what should i do. if i use while with an if statement to check the value then my CPU usage spikes up. tell me a feasible solution. pls
@ricardosouza7328
@ricardosouza7328 4 жыл бұрын
I'm from Brazil, I need your help is possible?
@joey7946
@joey7946 4 жыл бұрын
I would appreciate if you would continue to use idle :)
@dominator1699
@dominator1699 6 жыл бұрын
Hey tim, i currently wanted to make a Platformer-Type game where you can move and jump on other surfaces, but im getting stuck on the jumping bit, and i can't find any tutorial online. A lot of people said to start with turtle because its easier than pygame, can you help me?
@TechWithTim
@TechWithTim 6 жыл бұрын
If you need individual help I charge $30/hour CAD you can contact me at techwithtimm@gmail.com
@warrobotsgaming4067
@warrobotsgaming4067 3 жыл бұрын
i still dont know how to install turtle :(
@alok7485
@alok7485 6 жыл бұрын
Please tell how to bring more enemies more monsters how to reproduce health bar how to increase level of game and continue and save game
@yenicamargo21
@yenicamargo21 6 жыл бұрын
It shows that turtle has no atribute for listen
@TechWithTim
@TechWithTim 6 жыл бұрын
Make sure u call turtle.listen() not something like Tim.listen where Tim is an instance of the turtle
@danpat8135
@danpat8135 5 жыл бұрын
Were you by any chance using repl.it? Because it works on the Python app, but not repl.it
@swastiksarkar
@swastiksarkar 4 жыл бұрын
@@TechWithTim when I use turtle.listen() It says turtle module has no listen member. Plz help me!
@wowyok4507
@wowyok4507 2 жыл бұрын
not working
@koalakid3609
@koalakid3609 3 жыл бұрын
does NOT WORK
@edilgin
@edilgin 4 жыл бұрын
this was so helpful that i want to scream swears lol
@sanzharserik9835
@sanzharserik9835 5 жыл бұрын
thanks))))
@OzzuPlays
@OzzuPlays 5 жыл бұрын
real jjj What python version are you using?
@trial1496
@trial1496 4 жыл бұрын
print( 'can you start a group in discord for programming and stuff ')
@SGD2718
@SGD2718 5 жыл бұрын
I was typing the code and I was wondering why the definition of up(): was still black only to realize that I needed to remember to type def I type before up(): and I still can't believe how stupid I was to forget it. lol.
@darksun1463
@darksun1463 3 жыл бұрын
Кто из ртк + в чат
@netvoided7291
@netvoided7291 3 жыл бұрын
+
@ricardosouza7328
@ricardosouza7328 4 жыл бұрын
sorry my english
@rudywong8792
@rudywong8792 5 жыл бұрын
gg
@mognokhan1701
@mognokhan1701 4 жыл бұрын
Subscribers +=1
@premiummonkey1631
@premiummonkey1631 4 жыл бұрын
it shows red mark on the word turtle when im pressing run module says invalid syhtax why?
@milktar2182
@milktar2182 3 жыл бұрын
What does turtle.onkeyrelease() do?
Python Turtle Graphics Tutorial #4 - Drawing With Mouse
6:48
Tech With Tim
Рет қаралды 57 М.
Graphical Python Programming For Beginners with Turtle
26:41
NeuralNine
Рет қаралды 26 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
pixegami
Рет қаралды 300 М.
Using tkinter with classes
28:23
Atlas
Рет қаралды 76 М.
Coding Adventure: Boids
8:35
Sebastian Lague
Рет қаралды 1,6 МЛН
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 6 МЛН
5 Python Libraries You Should Know in 2025!
22:30
Keith Galli
Рет қаралды 87 М.
Make Pong With Python!
1:12:42
Tech With Tim
Рет қаралды 119 М.
Top 18 Most Useful Python Modules
10:50
Tech With Tim
Рет қаралды 936 М.
Make a Snake Game in Python | Turtle | Python Project
19:05
Coding With Evan
Рет қаралды 84 М.
PyGame Beginner Tutorial in Python - Adding Buttons
18:55
Coding With Russ
Рет қаралды 180 М.
How do non-euclidean games work? | Bitwise
14:19
DigiDigger
Рет қаралды 2,5 МЛН