Skip to content

Commit

Permalink
experiments on concurrency, speed, bubbles
Browse files Browse the repository at this point in the history
- worked on concurrency model #9,
- initial setup for speed #7
- copied code for cartoon bubbles #2
  • Loading branch information
DavidLeoni committed Aug 25, 2024
1 parent d802c74 commit efb56e7
Show file tree
Hide file tree
Showing 3 changed files with 454 additions and 84 deletions.
13 changes: 0 additions & 13 deletions cdtnge.py

This file was deleted.

51 changes: 23 additions & 28 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,31 +198,26 @@ def check_type(arg, *types):
#import time
import asyncio

#ada = Turtle(shape='img/turtle.svg')
ada = Turtle()

#await asyncio.sleep(1)

#for i in range(3):
ada.color('green')
ada.write("Ciao mondo!", align="right", font=("Courier", 18, "bold"))
ada.forward(100)
#time.sleep(1)
#await asyncio.sleep(1)
ada.done()
ada.left(90)

#time.sleep(1)
ada.done()

ada.circle(40)
ada.done()

ada.forward(100)

ada.color('blue')
ada.write("La la", align="center", font=("Times New Roman", 24, "italic"))
ada.done()
ada.left(90)
ada.forward(100)
ada.done()
# one after the other
"""
await test_turtleps()
await test_fumetti()
"""

# CAN'T DO WHEN ALREADY IN AN EVENT LOOP
"""
asyncio.run(asyncio.gather(
test_turtleps(),
test_fumetti(),
))
"""

# this works!
asyncio.gather(

test_turtleps(),
test_fumetti(),
)
print("Io vengo eseguito IMMEDIATAMENTE DOPO!")

Loading

0 comments on commit efb56e7

Please sign in to comment.