<s> import sys <EOL> import re <EOL> tag_re = re . compile ( "<STR_LIT>" ) <EOL> def write ( text ) : <EOL> pass <EOL> def writebr ( text ) : <EOL> pass <EOL> data = "<STR_LIT>" <EOL> def write_web ( text ) : <EOL> global data <EOL> from __pyjamas__ import JS <EOL> data += text <EOL> JS ( "<STR_LIT>" ) <EOL> def writebr_web ( text ) : <EOL> write ( text + "<STR_LIT>" ) <EOL> def init_web ( ) : <EOL> from __pyjamas__ import JS <EOL> JS ( """<STR_LIT>""" ) <EOL> def write_std ( text ) : <EOL> text = tag_re . sub ( "<STR_LIT>" , text ) <EOL> print text , <EOL> def writebr_std ( text ) : <EOL> text = tag_re . sub ( "<STR_LIT>" , text ) <EOL> print text <EOL> if sys . platform in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] : <EOL> init_web ( ) <EOL> write = write_web <EOL> writebr = writebr_web <EOL> else : <EOL> write = write_std <EOL> writebr = writebr_std </s>
