Loops
MATTHEWBECHTEL (124)

Does anyone now how to loop something?

You are viewing a single comment. View All
Answered by ArchieMaclean (781) [earned 5 cycles]
View Answer
MATTHEWBECHTEL (124)

Ok umm also is there a way to use Time.Sleep(1) but with a decimal as an time interval? For example: Time.Sleep(1.65) It would be super useful.

Geocube101 (566)

@MATTHEWBECHTEL It should work just as you typed it. Is it not working?

If not, try a lowercase 'T': time.sleep(value)

MATTHEWBECHTEL (124)

No it is, but I’m just wondering if decimals work in time.sleep @Geocube101 like time.sleep(.89)

ArchieMaclean (781)

@MATTHEWBECHTEL I think decimals work. Try it and see! If not,

import pygame
pygame.time.wait(10) # waits 10 ms

may work (not sure if it works on just python repls though)

MATTHEWBECHTEL (124)

Yes, I just realized that they work! Thank you. @ArchieMaclean