PageRenderTime 36ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/examples/libtest/write.py

http://pyjamas.googlecode.com/
Python | 16 lines | 15 code | 1 blank | 0 comment | 0 complexity | 93089979fb116211a825ba7a00011be7 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. import DOM
  2. def getBodyElement():
  3. JS(""" return $doc.body; """)
  4. def write(text):
  5. global data, element
  6. data += text
  7. DOM.setInnerHTML(element, data)
  8. def writebr(text):
  9. write(text + r"<BR>\n")
  10. data = ""
  11. element = DOM.createDiv()
  12. DOM.appendChild(getBodyElement(), element)