Reference for write_text
Write a text file. This is part of the reference section.
Arc
Buffer
Data
write_text
Dialog
Ellipse
Geo Utils
Image
Joystick (future)
Keyboard
Line
Mouse / Touchscreen
Pixel
Rectangle
Renderers
Shape
Sound (future)
Style
System
Text
Transform
Purpose
Write a text file, saving it to local file system or offering it as a download in the browser.
Snippet
Write a simple string to example.txt.
sketch.get_data_layer().write_text('test', 'example.json')
Parameters
- value: The string to writen.
- path: The location at which the file should be written.
Availability
Available for all platforms. On static and app renderers, will interpret path as a local file path using the operating system's conventions. For web, it will interpret path as a filename to use when dowloading the result.