D
D
Den5552019-01-27 20:07:43
Domain name market
Den555, 2019-01-27 20:07:43

How to use coordinates in Canvas?

I'm learning animation and there was a problem with one function.

from tkinter import*

root = TK()
c = Canvas(root, width = 200, height = 200, bg="white")
c.pack()

ball = c.create_oval(0, 100, 40, 140, fill="green")

def motion():
    c.move(ball, 1, 0)
    if c.coords(ball)[2] < 300:
         pass

motion()
root.mainloop()

What does the number 2 in square brackets mean in this part of the code?
if c.coords(ball)[2] < 300:
<code>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
landergate, 2016-06-06
@andrewpianykh

The search engine connects to the site by its DNS address.
While the site is unavailable via DNS, the search engine will not be able to connect to the site and receive a response about moving to another domain.
Correct - this is when the old domain is available and does a 301 on the new domain.
The transition to a new domain in the Google index can be accelerated through the Google Search Console: https://support.google.com/webmasters/answer/83106... (requires a 301 response from the old domain)
You need to figure out with the registrar what happened to the domain.

S
SubGANs, 2019-01-27
@Den555

2 means that only the 3rd element is taken from the list:
[1.0, 100.0, 41.0, 140.0]
41.0
The first output is the entire list, and the second digit is the 3rd element (counting from zero).
https://younglinux.info/tkinter/canvasmeth.php - here even your example is parsed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question