Skip to content

Commit a92f346

Browse files
committed
Level 09: Python 3.5
1 parent a587f7c commit a92f346

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

Level_09/async.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
import string
44
from sys import argv
55

6-
# alternativ (ab Python 3.5): async def
7-
@asyncio.coroutine
8-
def print_string(mystring, wait=0.1):
6+
async def print_string(mystring, wait=0.1):
97
while True:
108
print(mystring, end="", flush=True)
11-
yield from asyncio.sleep(wait) # alternativ (ab Python 3.5): await
9+
await asyncio.sleep(wait)
1210

1311
"""
1412
Die Event-Loop ist bei asyncio sehr wichtig.

0 commit comments

Comments
 (0)