MCPcopy Index your code
hub / github.com/pyscript/pyscript / download

Method download

core/src/stdlib/pyscript/web.py:1189–1200  ·  view source on GitHub ↗

Download the canvas content as an image file. Creates a temporary download link and triggers it.

(self, filename="snapped.png")

Source from the content-addressed store, hash-verified

1187 """
1188
1189 def download(self, filename="snapped.png"):
1190 """
1191 Download the canvas content as an image file.
1192
1193 Creates a temporary download link and triggers it.
1194 """
1195 # The `a` element class is dynamically created below.
1196 download_link = a( # noqa: F821
1197 download=filename, href=self._dom_element.toDataURL()
1198 )
1199 self.append(download_link)
1200 download_link._dom_element.click()
1201
1202 def draw(self, what, width=None, height=None):
1203 """

Callers 1

camera_clickFunction · 0.80

Calls 2

aFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected