Modifications

Sauter à la navigation Sauter à la recherche
232 octets ajoutés ,  21 février 2022 à 02:07
Ligne 6 : Ligne 6 :  
== Print and Waits ==
 
== Print and Waits ==
 
This first example how to output text with {{fname|print()}} and wait a moment with {{fname|sleep()}} .
 
This first example how to output text with {{fname|print()}} and wait a moment with {{fname|sleep()}} .
 +
 +
<syntaxhighlight lang="python">
 +
from time import sleep, sleep_ms
 +
 +
for x in range( 10 ):
 +
    print( "Value %i" % x )
 +
    sleep( 0.5 ) # half second
 +
</syntaxhighlight>
 +
 +
You can also sleep for milliseconds with {{fname|sleep_ms(x)}}
    
== Control an output ==
 
== Control an output ==
29 917

modifications

Menu de navigation