2020-07-16 | Paul Boddie | file changeset files shortlog | Fixed int limit macros by actually using the size of the int type. For wider types such as long, which may be usable on 64-bit platforms in place of int, 1L would need to be used instead of 1 in the calculation. An abstract native integer type might be introduced here and to the native library to allow wider types if appropriate. |
paul@424 | 1 | from sys import lstdin |
paul@424 | 2 | |
paul@532 | 3 | print lstdin # <libc.io.sysstream instance> |
paul@532 | 4 | print lstdin.encoding # ISO-8859-15 |
paul@424 | 5 | print "Reading 10 bytes..." |
paul@424 | 6 | s = lstdin.read(10) |
paul@424 | 7 | print s |
paul@424 | 8 | |
paul@424 | 9 | print "Reading to end of file..." |
paul@424 | 10 | s = lstdin.read() |
paul@424 | 11 | print s |