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 ? Calcul scientifique
avec Python
Voir le programme détaillé
Module « turtle » Python 3.13.2

Fonction register_shape - module turtle

Signature de la fonction register_shape

def register_shape(name, shape=None) 

Description

help(turtle.register_shape)

Adds a turtle shape to TurtleScreen's shapelist.

Arguments:
(1) name is the name of a gif-file and shape is None.
    Installs the corresponding image shape.
    !! Image-shapes DO NOT rotate when turning the turtle,
    !! so they do not display the heading of the turtle!
(2) name is an arbitrary string and shape is a tuple
    of pairs of coordinates. Installs the corresponding
    polygon shape
(3) name is an arbitrary string and shape is a
    (compound) Shape object. Installs the corresponding
    compound shape.
To use a shape, you have to issue the command shape(shapename).

call: register_shape("turtle.gif")
--or: register_shape("tri", ((0,0), (10,10), (-10,10)))

Example:
>>> register_shape("triangle", ((5,-3),(0,5),(-5,-3)))



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