Making a loop never ending #15530
-
I know this probably crazy but i cant for the life of me figure how to to loop a while loop to keep looping and not stop. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
while True:
do_stuff()
# if not using asyncio, might want time.sleep() or something to allow background tasks to happen
await asyncio.sleep_ms(100)
# in case you do ever want to break out of the loop
if _done:
break |
Beta Was this translation helpful? Give feedback.
-
Here what I was doing `` |
Beta Was this translation helpful? Give feedback.
-
import max7219 |
Beta Was this translation helpful? Give feedback.
-
With python the indentation of the file is important, it's part of the core syntax. |
Beta Was this translation helpful? Give feedback.
-
""
"" Thanks a bunch I got too work |
Beta Was this translation helpful? Give feedback.
-
Thanks andrewleech |
Beta Was this translation helpful? Give feedback.
With python the indentation of the file is important, it's part of the core syntax.
Things like
while
orif
all need their following code to be indented to show what's being run, as opposed to languages like C that use{
and}
to show these things