data = doc["txt_area"].html
with open("test.txt", 'w') as f:
f.write(data)
Thank you,--
Vitali
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/e8d7baa9-01d8-4582-b5e0-e5fd115f03ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/6be9bde7-4a5c-4088-9d6e-79e03358f05b%40googlegroups.com.
Since this is a browser environment, you cannot write to the OS. This is probably the easiest way to emulate a file system in a browser environment.you could try:
from browser import local_storage
local_storage.storage["test.txt"]=data
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/CAB1ii-cZ_4E%2BNn0YsPONQYAmsRX1U2pXec-VqkewfAmnz32qkg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/CAB-sx61XKTKUvP6oPr1ahQtaMGfZMvmb9sgXOvV67MMOiR6KKw%40mail.gmail.com.
There's an idea..what about expanding the open function so that if someone appends a file/path with 'localstorage:', we know to read/write to local storage, and otherwise it is a URL call?This is kind of like sqlite3 with its open function with an argument of ":memory:", which means to write the database only to memory and not disk.