Re: Working with information from other files.

31 views
Skip to first unread message
Message has been deleted

Jonathan Verner

unread,
Aug 9, 2017, 5:00:38 AM8/9/17
to brython
The first part is easy, instead of 

document['navbar'] <= nav

you put

document['navbar'].innerHTML = nav.read()

The second part will need some work on the server as the browser can't write to files on the server. You will probably need to have a server-side script where you post the new file contents and the scripts saves them to the file...


On Tuesday, August 8, 2017 at 3:38:23 PM UTC+2, Vladimir wrote:
How to include html elements from another html file? If you will just open it and send it to some zone of your document it will appear as a regular text instead of the html element.
Brython script:
from browser import document
nav
= open('navbar.html')
document
['navbar'] <= nav

How to append some text from your input to the txt file and then display it? On python I've got this:
import time
data
= open('datastore.txt', 'r')
print(data.read())
inputdata
= input()
data
= open('datastore.txt', 'a')
data
.write('\n' + inputdata + ' ' + time.asctime())
data
= open('datastore.txt', 'r')
print(data.read())


Reply all
Reply to author
Forward
0 new messages