We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da37a00 commit d3ca9e2Copy full SHA for d3ca9e2
examples/parallel.py
@@ -4,12 +4,15 @@
4
5
6
async def main():
7
- await asyncio.gather(spawn_codebox() for _ in range(10))
+ await asyncio.gather(*(spawn_codebox() for _ in range(10)))
8
9
10
async def spawn_codebox():
11
async with CodeBox() as codebox:
12
- print(await codebox.arun("print('Hello World!')"))
+ await codebox.arun("a = 'Hello World!'")
13
+ a = await codebox.arun("a")
14
+ assert a == "Hello World!"
15
+ print("Success!")
16
17
18
if __name__ == "__main__":
0 commit comments