Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé
Module « turtle » Python 3.13.2

Fonction teleport - module turtle

Signature de la fonction teleport

def teleport(x=None, y=None, *, fill_gap: bool = False) -> None 

Description

help(turtle.teleport)

Instantly move turtle to an absolute position.

Arguments:
x -- a number      or     None
y -- a number             None
fill_gap -- a boolean     This argument must be specified by name.

call: teleport(x, y)         # two coordinates
--or: teleport(x)            # teleport to x position, keeping y as is
--or: teleport(y=y)          # teleport to y position, keeping x as is
--or: teleport(x, y, fill_gap=True)
                             # teleport but fill the gap in between

Move turtle to an absolute position. Unlike goto(x, y), a line will not
be drawn. The turtle's orientation does not change. If currently
filling, the polygon(s) teleported from will be filled after leaving,
and filling will begin again after teleporting. This can be disabled
with fill_gap=True, which makes the imaginary line traveled during
teleporting act as a fill barrier like in goto(x, y).

Example:
>>> tp = pos()
>>> tp
(0.00,0.00)
>>> teleport(60)
>>> pos()
(60.00,0.00)
>>> teleport(y=10)
>>> pos()
(60.00,10.00)
>>> teleport(20, 30)
>>> pos()
(20.00,30.00)


Vous êtes un professionnel et vous avez besoin d'une formation ? Mise en oeuvre d'IHM
avec Qt et PySide6
Voir le programme détaillé