Due to security issues, it is not possible to write directly from a browser to an arbitrary file in the user's computer storage. However, a browser can write to the user's download folder. In Web VPython you can write a string to the download folder using the download function:
download(filename, data)
Both the filename and the data must be strings. A useful way to create the data string is to use Python f-strings; see Text Output. Note that repeated execution with the same file name results in the later downloaded files having (1), (2), (3)..added .to the file name.
--
---
You received this message because you are subscribed to the Google Groups "Glowscript Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glowscript-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glowscript-users/5d64ae1f-d824-4659-930b-2d23603f5a94n%40googlegroups.com.