How to Draw Lines and Shapes With Canvas - Python Tkinter GUI Tutorial #68

  Рет қаралды 102,163

Codemy.com

Codemy.com

Күн бұрын

Пікірлер: 104
@Codemycom
@Codemycom 4 жыл бұрын
▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My KZbin Channel: bit.ly/2UFLKgj bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
@kenhaley4
@kenhaley4 4 жыл бұрын
Your coordinate system (as illustrated at 4:24 and after) is upside down. The origin is in the upper left corner, not lower left. If you create a line from (0,0) to (200, 100), for example, it starts in the upper left corner and goes down and to the right. It didn't affect any of your examples, since they're all vertically symmetric about the middle of the canvas.
@stickydamper
@stickydamper 4 жыл бұрын
thanks
@jamespaz4103
@jamespaz4103 3 жыл бұрын
Yah I noticed when I try it myself, and test bunch of shapes. I later figured the coordinate is upside down.
@auntikjeb6600
@auntikjeb6600 3 жыл бұрын
You are, by far, the coolest KZbin python teacher.....I mean your way of speaking and way of teaching is impeccable.Your endeavors are self rewarding. Anyone with no knowledge of programming can understand what does a certain line of code mean if s/he watches your video. Best of Luck man...Loved it....
@Codemycom
@Codemycom 3 жыл бұрын
Thanks! Appreciate that!
@garrett6064
@garrett6064 3 жыл бұрын
Codes to draw a red line and says "Now let's run it." Cut to commercial for computer game with super cool graphics. Me: holy shit!
@mujassimjamal24
@mujassimjamal24 4 жыл бұрын
Thats what i need! I was huge confused about canvas and now my topic has cleared. Thank you so much sir ❤❤❤
@Codemycom
@Codemycom 4 жыл бұрын
Most welcome 😊
@brauliogarcia1836
@brauliogarcia1836 2 жыл бұрын
I like the way you teach, thank you for sharing your knowledge!
@Codemycom
@Codemycom 2 жыл бұрын
Thanks for watching!
@patriciamanroe6371
@patriciamanroe6371 3 жыл бұрын
Thank you, I'm going to college for my BS in Computer Science/Software Engineering and just took a course on Python.
@Codemycom
@Codemycom 3 жыл бұрын
Awesome
@kapibara2440
@kapibara2440 7 ай бұрын
A very interesting intro to Canvas!
@Codemycom
@Codemycom 7 ай бұрын
thanks!
@fizoolplayer
@fizoolplayer 4 жыл бұрын
Liked subscribed and shared, not just coz your great but also look a lot like one of best friends.
@Codemycom
@Codemycom 4 жыл бұрын
Ha, fun!
@asrajo5728
@asrajo5728 3 жыл бұрын
thanks codemy, you save my life..... 🙏🙏🙏
@Codemycom
@Codemycom 3 жыл бұрын
Happy to help
@funnyclips2696
@funnyclips2696 2 жыл бұрын
It's just awesome! Even though my background is Urban planning and GIS, I always learned from your simplified tutorials. 👌🏿
@Codemycom
@Codemycom 2 жыл бұрын
Happy to hear it!
@Asifkhan-yn3ty
@Asifkhan-yn3ty 3 жыл бұрын
Short + effective and helpful videos....Subscribed ✨
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@akramelomrani8728
@akramelomrani8728 4 жыл бұрын
I just learned the pygame graph systeme and now I need to learn another one
@eutral
@eutral Жыл бұрын
This is indeed a helpful tutorial, but you have flipped the Y-axis. Y-position is 0 at the top and increases as it goes towards the bottom
@josephlopez348
@josephlopez348 4 жыл бұрын
Is the coordinate system platform or system dependent? I'm doing mine on Windows 10 on Python 3.8 and my 0,0 seems to be in the top left of the canvas when I experimented with different numbers.
@garrett6064
@garrett6064 3 жыл бұрын
he drew it wrong and because he put it in the middle it didn't matter that it was from top or bottom. But upper left is always 0, 0.
@JoeMamaJunk
@JoeMamaJunk 2 жыл бұрын
Can you make a video on how to program a bucket/flood fill function that can be used on Tkinter canvases?
@demaischta1129
@demaischta1129 3 жыл бұрын
Thank you, great Tutorial! I did some testing and got confused with the cordinate-system. Y-axis goes down not up! So 0, 0 is the point at the top left corner not bottom left corner
@abhinavdubey8077
@abhinavdubey8077 2 жыл бұрын
very informative video ..
@geetachavan2916
@geetachavan2916 Жыл бұрын
this is so much helpful
@Codemycom
@Codemycom Жыл бұрын
glad you enjoyed it!
@rolynx5787
@rolynx5787 3 жыл бұрын
Thanks for the guide.
@Codemycom
@Codemycom 3 жыл бұрын
Happy to help
@ntcellulartutorials1195
@ntcellulartutorials1195 4 жыл бұрын
Thank you very much for all tutorials in the paid package do you have libusb, os module and Django covered?
@Codemycom
@Codemycom 4 жыл бұрын
I have many courses on Django, some things use os module marginally (but I don't have a course on just that), and no clue what libusb is. You can see all my courses listed on the homepage of Codemy.com and you can click on each one to get full details of what they're about.
@jokarjapan
@jokarjapan 2 жыл бұрын
clear explains, thank you
@imanidioli
@imanidioli 2 жыл бұрын
Thanks a lot for your great content, since you explained on another video that a UI is a loop that is constantly rendering, is it possible to draw a shape shifting rectangle with dynamic coordinations?
@radhayamini9761
@radhayamini9761 4 жыл бұрын
how to add a Label right Next to the canvas created? Like as Select File: Canvas Shape(ex:Rectangle) and next a Browse Button next to it
@Codemycom
@Codemycom 4 жыл бұрын
In the normal way you would add a label to a widget
@paulpaul6042
@paulpaul6042 2 жыл бұрын
Hey Is that possible to put inside that canvas 2 random points (X) distance to a 1point moving (Y).. like Y moving inside randomly and we see distance to X points
@RyanDanielG
@RyanDanielG 3 жыл бұрын
feed the algorithm! great vid
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@bcburnettcom
@bcburnettcom 3 жыл бұрын
since folks are still viewing this, could you please do an info box when the coordinate system is displayed that states its wrong!
@Codemycom
@Codemycom 3 жыл бұрын
huh?
@edwardayoub4182
@edwardayoub4182 4 жыл бұрын
this is really lit, thanks a lot!
@Codemycom
@Codemycom 4 жыл бұрын
Glad you like it!
@ejm209
@ejm209 4 жыл бұрын
Great content man keep it up!
@Codemycom
@Codemycom 4 жыл бұрын
Thanks, will do!
@solybr2271
@solybr2271 2 жыл бұрын
Hi, in my project i have to do it on video stream. Do you have any idea how can I do it please?
@Codemycom
@Codemycom 2 жыл бұрын
No, sorry I don't know what you mean.
@canozgur4549
@canozgur4549 4 жыл бұрын
Thats really good . Could you make program like somthing whick exactly work program .it is like your geography porgram.
@Codemycom
@Codemycom 4 жыл бұрын
Not sure what you mean...
@quaterman1270
@quaterman1270 6 ай бұрын
x coordinate starts on the left side and the y coordinates start at the top. Your x was correct but your y coordinate needs to sart at the top. Top is 0 and bottom is 200
@Codemycom
@Codemycom 6 ай бұрын
seemed to work fine in the video
@quaterman1270
@quaterman1270 6 ай бұрын
@@Codemycom of course it works, the coordinates of y are just wrong :D Did you not notice at 10:04 that your rectangle was not at the position you expected?
@infinitespace1982
@infinitespace1982 3 жыл бұрын
Umm. I have a problem, the buttons that I have created in a frame don't recognize the root, hence when I try to destroy the root when clicking a button in the frame, it displays an error message: root.destroy() UnboundLocalError: local variable 'root' referenced before assignment Both the frame and the button are in the root.
@giorgibakuradze
@giorgibakuradze 4 жыл бұрын
hi, can you record the video for Scrolling multiple window, not list, just window (with class). for example: I have one window with many buttons, So it needs Scroll. When I click on any buttons, I i pop up to a new window and it need to scroll there as well. In any case, you are the best
@Codemycom
@Codemycom 4 жыл бұрын
I don't have plans to do that anytime soon, sorry
@giorgibakuradze
@giorgibakuradze 4 жыл бұрын
@@Codemycom looking forward
@Codemycom
@Codemycom 4 жыл бұрын
@@giorgibakuradze to what? lol
@pheart6
@pheart6 4 жыл бұрын
Would you like to make a playlist of c++ gui programming.
@Codemycom
@Codemycom 4 жыл бұрын
No, I don't use C++
@giovannimariotte4993
@giovannimariotte4993 4 жыл бұрын
Awesome
@Codemycom
@Codemycom 4 жыл бұрын
Thanks!
@Zellos376
@Zellos376 7 ай бұрын
Thank you very much
@Codemycom
@Codemycom 7 ай бұрын
You are welcome
@somerandomgadzo4778
@somerandomgadzo4778 Жыл бұрын
Bro is Walter White. "I am the one who CODES"
@Codemycom
@Codemycom Жыл бұрын
lol
@chief4536
@chief4536 3 жыл бұрын
How do you position the square
@asmeergillani2991
@asmeergillani2991 2 жыл бұрын
Can you please explain why you wrote my_canvas.create_rectangle
@Codemycom
@Codemycom 2 жыл бұрын
to create the rectangle
@domzcafe6305
@domzcafe6305 3 жыл бұрын
How can i make curve lines
@Hamheadon
@Hamheadon 2 жыл бұрын
Can you add labels to a canvas
@Codemycom
@Codemycom 2 жыл бұрын
Of course...I have videos on that in the playlist somewhere
@Mark00747
@Mark00747 2 жыл бұрын
Could you let the user create custom lines with the cursor?
@Codemycom
@Codemycom 2 жыл бұрын
not sure what you mean
@Mark00747
@Mark00747 2 жыл бұрын
@@Codemycom I mean this! kzbin.info/www/bejne/nF7XlYOpaZaNl8k
@Codemycom
@Codemycom 2 жыл бұрын
@@Mark00747 I don't have any videos on anything like that
@Mark00747
@Mark00747 2 жыл бұрын
@@Codemycom I've fixed it with PyGame, but thanks anyway!
@kumkumslab5811
@kumkumslab5811 4 жыл бұрын
Sir please can you tell me that how to make qr generator
@Codemycom
@Codemycom 4 жыл бұрын
Sorry, I don't have any videos on that
@manishshah2694
@manishshah2694 3 жыл бұрын
when I write- my_canvas.create_line(0,300,200,100, fill = "red) it shows an error written as 'nonetype' object has no attribute 'create_line
@shubhamshinde5643
@shubhamshinde5643 3 жыл бұрын
Check spelling of my_canvas in code
@synamalhan427
@synamalhan427 3 жыл бұрын
if you have written .pack() on the same line as where you have created the canvas it will attribute nonetype to the object, trying packing it in the next line instead.
@darkiiq8527
@darkiiq8527 3 жыл бұрын
How can i create a circle without it pixels appear in the edge
@adammax9902
@adammax9902 Жыл бұрын
shouldn't the rectangle be closer to the bottom
@elysonpanolino5413
@elysonpanolino5413 2 жыл бұрын
how do i put text in tkinter canvas
@Codemycom
@Codemycom 2 жыл бұрын
I have videos on that in the playlist
@lemonsquezy11
@lemonsquezy11 Жыл бұрын
TYSM!!!
@Codemycom
@Codemycom Жыл бұрын
welcome!
@AnujSingh-jq5ob
@AnujSingh-jq5ob 4 жыл бұрын
Thank you
@Codemycom
@Codemycom 4 жыл бұрын
You're very welcome!
@fernandohood5542
@fernandohood5542 4 жыл бұрын
Glad the the co-ordinate system has 0,0 at the bottom left. Oppps not true.
@Codemycom
@Codemycom 4 жыл бұрын
lol
@jaaz1981
@jaaz1981 3 жыл бұрын
wow
@Codemycom
@Codemycom 3 жыл бұрын
:-)
Create Stunning Python GUIs in 10 Minutes With Drag & Drop
11:38
Coding Is Fun
Рет қаралды 109 М.
ВЛОГ ДИАНА В ТУРЦИИ
1:31:22
Lady Diana VLOG
Рет қаралды 1,2 МЛН
SLIDE #shortssprintbrasil
0:31
Natan por Aí
Рет қаралды 49 МЛН
The grid layout method in tkinter
22:44
Atlas
Рет қаралды 38 М.
The Manim Experience - Creating animations with Python
38:51
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 102 М.
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,6 МЛН
I made maps that show time instead of space
10:44
Václav Volhejn
Рет қаралды 1 МЛН
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 6 МЛН
I never understood why you can't go faster than light - until now!
16:40
FloatHeadPhysics
Рет қаралды 5 МЛН
Understanding the inbuild tkinter styling methods
14:46
Atlas
Рет қаралды 13 М.
The Genius Way Computers Multiply Big Numbers
22:04
PurpleMind
Рет қаралды 259 М.
How to Draw Circles, Rectangles and Lines in Kivy for Python!
16:35
LeMaster Tech
Рет қаралды 1,2 М.