Something like this; not sure what it doesn't like.
Chris Pressey
7 years ago
380 | 380 | |
381 | 381 | |
382 | 382 | def rpython_input(): |
383 | return 0 | |
383 | import os | |
384 | s = os.read(1, 1) | |
385 | if not s: | |
386 | return 0 | |
387 | return ord(s) | |
384 | 388 | |
385 | 389 | def rpython_output(code): |
386 | print "&#%d;" % code | |
390 | import os | |
391 | os.write(0, unichr(code).encode('utf-8')) | |
387 | 392 | |
388 | 393 | |
389 | 394 | def rpython_main(argv): |