-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
render.download
in Shiny Express, take 2 (#1085)
- Loading branch information
Showing
3 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import asyncio | ||
import random | ||
from datetime import date | ||
|
||
from shiny.express import render | ||
|
||
|
||
@render.download( | ||
filename=lambda: f"新型-{date.today().isoformat()}-{random.randint(100,999)}.csv" | ||
) | ||
async def downloadData(): | ||
await asyncio.sleep(0.25) | ||
yield "one,two,three\n" | ||
yield "新,1,2\n" | ||
yield "型,4,5\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters